CVE-2026-48054

OpenZeppelin Contracts Wizard has Code Injection in Generated Hardhat and Foundry Tests via Unsanitized opts.name / opts.uri

Published Aug 6, 2026 CVSS 3.1 · 8.8 High EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical impact

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:48 and :50 without any JavaScript string escaping. No authentication is required; an attacker can craft a malicious URL such as https://wizard.openzeppelin.com/#/erc20?name="");require("child_process").execSync("...");(" and share 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. This flaw is a classic code injection (CWE‑94).

Affected Systems

OpenZeppelin Contracts Wizard, deployed as a web application by OpenZeppelin, is the affected product. All releases prior to version 0.10.9 carry this flaw. The vulnerability is triggered by unescaped user inputs during test file generation, irrespective of the contract type chosen (ERC20, ERC721, ERC1155). Developers who use earlier releases and download the generated test archives are at risk. Updating to 0.10.9 or later removes the code injection path.

Risk and Exploitability

The CVSS score of 8.8 classifies the issue as high severity, reflecting the potential for remote code execution with local system privileges. Because the wizard is publicly can construct a malicious URL that embeds arbitrary Node.js code and easily distribute it to unsuspecting developers. When the victim runs the included test file, the code executes as the invoking user. The EPSS score of < 1% indicates a very low exploitation probability, but the open‑browser nature of the application still suggests a potential risk. The vulnerability is not listed in CISA’s KEV catalog, but the ease of creating and sharing the attack activity.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade OpenZeppelin Contracts Wizard to version 0.10.9 or later to eliminate the unsanitized string interpolation bug.
  • Never accept or run test files from unknown or untrusted sources; verify URLs and inspect the generated code before executing.
  • Run the wizard and subsequent test execution in an isolated, restricted environment (e.g., sandboxed container or CI pipeline) to contain any potential code execution.

Generated by OpenCVE AI on September 21, 2026 at 07:18 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-4x76-22x2-rx8v OpenZeppelin Contracts Wizard has Code Injection in Generated Hardhat and Foundry Tests via Unsanitized opts.name / opts.uri
History
Type Values Removed Values Added
Description OpenZeppelin Contracts Wizardis 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. 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.
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Openzeppelin
Openzeppelin contracts-wizard
Vendors & Products Openzeppelin
Openzeppelin contracts-wizard
Type Values Removed Values Added
Description OpenZeppelin Contracts Wizardis 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.
Title OpenZeppelin Contracts Wizard has Code Injection in Generated Hardhat and Foundry Tests via Unsanitized opts.name / opts.uri
Weaknesses CWE-94
References
Metrics cvssV3_1

{'score': 8.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'}

Weaknesses
  • CWE-94

    Improper Control of Generation of Code ('Code Injection')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Sep 14, 2026, 5:42 PM
Reserved
May 20, 2026, 6:15 PM
Status
Deferred
Published
Aug 6, 2026, 10:17 PM
Modified
Sep 14, 2026, 6:17 PM