CVE-2026-48054: CWE-94: Improper Control of Generation of Code ('Code Injection') in OpenZeppelin contracts-wizard
OpenZeppelin Contracts Wizard is a web application to interactively build a contract out of components from OpenZeppelin Contracts. Versions prior to 0.10.9 generate a Hardhat test file (`test/test.ts`) by interpolating user-supplied `opts.name` (ERC20/ERC721) and `opts.uri` (ERC1155) directly into TypeScript string literals at `zip-hardhat.ts:48` and `:50` without any JavaScript string escaping. No authentication is required: an attacker crafts a URL such as `https[:]//wizard[.]openzeppelin[.]com/#/erc20?name=");require("child_process").execSync("...");("` and shares it with a developer. When the victim downloads the resulting zip archive and runs `npx hardhat test`, the injected Node.js code executes with the developer's local OS privileges. Version 0.10.9 fixes the issue.
AI Analysis
Technical Summary
OpenZeppelin Contracts Wizard versions before 0.10.9 contain a code injection vulnerability (CWE-94) due to improper control of code generation. Specifically, user inputs `opts.name` and `opts.uri` are interpolated directly into a Hardhat test file's TypeScript string literals without JavaScript string escaping at zip-hardhat.ts lines 48 and 50. An attacker can craft a URL embedding malicious Node.js code that executes when the developer downloads the generated zip and runs `npx hardhat test`. This leads to arbitrary code execution with the developer's local OS privileges. Version 0.10.9 addresses this vulnerability.
Potential Impact
Successful exploitation allows an attacker to execute arbitrary Node.js code on the developer's machine with their local OS privileges when running the generated Hardhat test. This can lead to full compromise of the developer environment, including data theft, system manipulation, or further attacks. No authentication is required to trigger this vulnerability, increasing its risk.
Mitigation Recommendations
Upgrade to OpenZeppelin contracts-wizard version 0.10.9 or later, which fixes this code injection vulnerability by properly escaping user inputs in generated test files. Until upgrading, avoid running Hardhat tests generated from untrusted or suspicious URLs. There is no vendor advisory explicitly stating no action is required or that the issue is already mitigated, so applying the official fix is recommended.
CVE-2026-48054: CWE-94: Improper Control of Generation of Code ('Code Injection') in OpenZeppelin contracts-wizard
Description
OpenZeppelin Contracts Wizard is a web application to interactively build a contract out of components from OpenZeppelin Contracts. Versions prior to 0.10.9 generate a Hardhat test file (`test/test.ts`) by interpolating user-supplied `opts.name` (ERC20/ERC721) and `opts.uri` (ERC1155) directly into TypeScript string literals at `zip-hardhat.ts:48` and `:50` without any JavaScript string escaping. No authentication is required: an attacker crafts a URL such as `https[:]//wizard[.]openzeppelin[.]com/#/erc20?name=");require("child_process").execSync("...");("` and shares it with a developer. When the victim downloads the resulting zip archive and runs `npx hardhat test`, the injected Node.js code executes with the developer's local OS privileges. Version 0.10.9 fixes the issue.
CVSS v3.1
Score 8.8high
Affected software
OpenZeppelin
contracts-wizard
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
OpenZeppelin Contracts Wizard versions before 0.10.9 contain a code injection vulnerability (CWE-94) due to improper control of code generation. Specifically, user inputs `opts.name` and `opts.uri` are interpolated directly into a Hardhat test file's TypeScript string literals without JavaScript string escaping at zip-hardhat.ts lines 48 and 50. An attacker can craft a URL embedding malicious Node.js code that executes when the developer downloads the generated zip and runs `npx hardhat test`. This leads to arbitrary code execution with the developer's local OS privileges. Version 0.10.9 addresses this vulnerability.
Potential Impact
Successful exploitation allows an attacker to execute arbitrary Node.js code on the developer's machine with their local OS privileges when running the generated Hardhat test. This can lead to full compromise of the developer environment, including data theft, system manipulation, or further attacks. No authentication is required to trigger this vulnerability, increasing its risk.
Mitigation Recommendations
Upgrade to OpenZeppelin contracts-wizard version 0.10.9 or later, which fixes this code injection vulnerability by properly escaping user inputs in generated test files. Until upgrading, avoid running Hardhat tests generated from untrusted or suspicious URLs. There is no vendor advisory explicitly stating no action is required or that the issue is already mitigated, so applying the official fix is recommended.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-05-20T18:15:53.579Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 6a750702bf8831d5395f59d0
Added to database: 08/06/2026, 22:13:22 UTC
Last enriched: 08/14/2026, 16:04:48 UTC
Last updated: 09/21/2026, 22:01:35 UTC
Views: 34
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.