Skip to main content
EPSS 0.4%top 62%

CVE-2026-48054: CWE-94: Improper Control of Generation of Code ('Code Injection') in OpenZeppelin contracts-wizard

0
High
VulnerabilityCVE-2026-48054cvecve-2026-48054cwe-94
Published: 08/06/2026 (08/06/2026, 21:37:54 UTC)
Source: CVE Database V5
Vendor/Project: OpenZeppelin
Product: 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

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Affected software

OpenZeppelin

contracts-wizard

Affected versions
<0.10.9

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 08/14/2026, 16:04:48 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses