OpenZeppelin Contracts Wizard CVE-2026-48054
HIGHSeverity by source
AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Attacker input reaches a network-reachable integrator without auth (AV:N/PR:N), exploitation needs only a crafted string (AC:L), but a developer must run the generated tests (UI:R), yielding full RCE (C/I/A:H).
Primary rating from GitHub Advisory.
CVSS VectorGitHub Advisory
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Lifecycle Timeline
2DescriptionGitHub Advisory
Summary
The OpenZeppelin Contracts Wizard generated Hardhat (test/test.ts) and Foundry (test/<Name>.t.sol) example test files that interpolated user-supplied strings (opts.name, opts.uri) into the test source without escaping. A crafted input could produce a generated test file in which the input string broke out of its surrounding literal and was parsed as code, executing when a developer ran npm test or forge test on the downloaded project.
Impact
- Users of the hosted Wizard at https://wizard.openzeppelin.com: no action required. The site has been redeployed with the fix.
- Users of
@openzeppelin/wizardvia the documented public API: not affected. The vulnerable functions (zipHardhat,zipFoundry) are not part of the package's documented public exports. - Callers of
zipHardhat/zipFoundrywho forward externally-controlled strings intoopts.name/opts.uri: upgrade to0.10.9.
Patches
Fixed in @openzeppelin/wizard@0.10.9.
Articles & Coverage 2
AnalysisAI
Code injection in OpenZeppelin Contracts Wizard's @openzeppelin/wizard npm package (<=0.10.8) allows attacker-supplied strings passed through opts.name or opts.uri into the zipHardhat/zipFoundry helpers to break out of string literals inside generated Hardhat and Foundry test scaffolding, leading to arbitrary code execution on the developer's machine when npm test or forge test is run. No public exploit is identified at time of analysis, but a vendor advisory and patched commit are public via GitHub Security Advisory GHSA-4x76-22x2-rx8v.
Technical ContextAI
The flaw lives in packages/core/solidity/src/utils/sanitize.ts which previously used JSON.stringify for ASCII and a naive replace(/"/g, '\"') for unicode bodies when embedding user strings into Solidity (unicode"...") and TypeScript string literals inside the generated test/<Name>.t.sol and test/test.ts files. Because Solidity's unicode"..." literal treats \ as an escape and excludes CR/LF/VT from its raw body, an input such as é\"); could terminate the literal and inject statements; the same pattern broke TypeScript literals in the Hardhat template. This is a classic CWE-94 (Improper Control of Generation of Code) injection that manifests at code-generation time rather than at runtime of the wizard itself, and only affects integrators who feed externally-controlled values to the undocumented zipHardhat/zipFoundry exports (CPE: pkg:npm/@openzeppelin/wizard).
RemediationAI
Vendor-released patch: @openzeppelin/wizard@0.10.9 - upgrade any project that calls zipHardhat or zipFoundry to this version (fix commit ec12c44f8d9e0491eba31037f95b36e98ec58b5f, advisory GHSA-4x76-22x2-rx8v). If upgrading is delayed, integrators should stop forwarding externally-controlled input into opts.name/opts.uri, or pre-sanitize those values by rejecting strings containing ", \, CR, LF, and vertical tab before invoking the undocumented zipHardhat/zipFoundry functions - accepting the trade-off that legitimate non-ASCII project names may be rejected. As an additional compensating control, do not execute npm test or forge test on wizard-generated projects whose inputs originated from untrusted users until they have been reviewed.
A vulnerability in the NuPoint Unified Messaging (NPM) component of Mitel MiCollab through 9.8 SP1 FP2 (9.8.1.201) could
FortiOS and FortiProxy contain an authentication bypass via the Node.js websocket module allowing unauthenticated remote
Eval injection vulnerability in the internals.batch function in lib/batch.js in the bassmaster plugin before 1.5.2 for t
Flowise version 3.0.5 contains a remote code execution vulnerability in the CustomMCP node. The mcpServerConfig paramete
Node.js 8.5.0 before 8.6.0 allows remote attackers to access unintended files, because a change to ".." handling was inc
An issue was discovered in the node-serialize package 0.0.4 for Node.js. Rated critical severity (CVSS 9.8), this vulner
Directory traversal vulnerability in the st module before 0.2.5 for Node.js allows remote attackers to read arbitrary fi
Multiple SQL injection vulnerabilities in the Manage Accounts page in the AccountManagement.asmx service in the Solarwin
The JS-YAML module before 2.0.5 for Node.js parses input without properly considering the unsafe !!js/function tag, whic
Directory traversal vulnerability in lib/app/index.js in Geddy before 13.0.8 for Node.js allows remote attackers to read
Credential-harvesting malware compromised 84 versions of 42 TanStack npm packages on 2026-05-11 via chained GitHub Actio
Eval injection vulnerability in index.js in the syntax-error package before 1.1.1 for Node.js 0.10.x, as used in IBM Rat
Same weakness CWE-94 – Code Injection
View allSame technique Code Injection
View allShare
External POC / Exploit Code
Leaving vuln.today
GHSA-4x76-22x2-rx8v