CVE-2026-48054: CWE-94: Improper Control of Generation of Code ('Code Injection') in OpenZeppelin contracts-wizard
CVE-2026-48054 is a code injection vulnerability in OpenZeppelin Contracts Wizard versions prior to 0.10.9. The web application generates a Hardhat test file by directly interpolating user-supplied input into TypeScript string literals without proper escaping. This allows an attacker to craft a malicious URL that injects Node.js code, which executes with the developer's local OS privileges when the test is run. The issue is fixed in version 0.10.9.
AI Analysis
Technical Summary
OpenZeppelin Contracts Wizard is a web application that helps build smart contracts from OpenZeppelin components. Versions before 0.10.9 generate a Hardhat test file (`test/test.ts`) by embedding user inputs `opts.name` and `opts.uri` directly into TypeScript string literals without escaping. An attacker can craft a URL containing malicious code in these parameters. When a developer downloads the generated zip and runs `npx hardhat test`, the injected Node.js code executes with the developer's OS privileges, leading to potential arbitrary code execution. Version 0.10.9 addresses this vulnerability by fixing the unsafe interpolation.
Potential Impact
Successful exploitation allows an attacker to execute arbitrary Node.js code on a developer's machine with the developer's local operating system privileges. This can lead to full compromise of the developer environment, including access to files, credentials, and further network pivoting. The vulnerability requires the developer to download and run the generated test code, but no authentication is required to craft the malicious URL.
Mitigation Recommendations
Upgrade to OpenZeppelin Contracts Wizard version 0.10.9 or later, which fixes the unsafe code interpolation issue. Until upgrading, avoid downloading and running test files generated from untrusted or suspicious URLs. Exercise caution when using the Contracts Wizard with user-supplied parameters and verify the contents of generated test files before execution.
CVE-2026-48054: CWE-94: Improper Control of Generation of Code ('Code Injection') in OpenZeppelin contracts-wizard
Description
CVE-2026-48054 is a code injection vulnerability in OpenZeppelin Contracts Wizard versions prior to 0.10.9. The web application generates a Hardhat test file by directly interpolating user-supplied input into TypeScript string literals without proper escaping. This allows an attacker to craft a malicious URL that injects Node.js code, which executes with the developer's local OS privileges when the test is run. The issue is fixed in version 0.10.9.
CVSS v3.1
Score 8.8high
Affected software
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
OpenZeppelin Contracts Wizard is a web application that helps build smart contracts from OpenZeppelin components. Versions before 0.10.9 generate a Hardhat test file (`test/test.ts`) by embedding user inputs `opts.name` and `opts.uri` directly into TypeScript string literals without escaping. An attacker can craft a URL containing malicious code in these parameters. When a developer downloads the generated zip and runs `npx hardhat test`, the injected Node.js code executes with the developer's OS privileges, leading to potential arbitrary code execution. Version 0.10.9 addresses this vulnerability by fixing the unsafe interpolation.
Potential Impact
Successful exploitation allows an attacker to execute arbitrary Node.js code on a developer's machine with the developer's local operating system privileges. This can lead to full compromise of the developer environment, including access to files, credentials, and further network pivoting. The vulnerability requires the developer to download and run the generated test code, but no authentication is required to craft the malicious URL.
Mitigation Recommendations
Upgrade to OpenZeppelin Contracts Wizard version 0.10.9 or later, which fixes the unsafe code interpolation issue. Until upgrading, avoid downloading and running test files generated from untrusted or suspicious URLs. Exercise caution when using the Contracts Wizard with user-supplied parameters and verify the contents of generated test files before execution.
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
- Remediation Level
- null
Threat ID: 6a750702bf8831d5395f59d0
Added to database: 08/06/2026, 22:13:22 UTC
Last enriched: 08/06/2026, 23:11:16 UTC
Last updated: 08/06/2026, 23:41:19 UTC
Views: 4
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.