CVE-2026-48054: @openzeppelin/wizard OpenZeppelin Contracts Wizard Has Code Vulnerability

HIGH
Advisory Identifier: GHSA-4x76-22x2-rx8v
CVSS 8.8
CWE-94
Published
Advisory Summary

CVE-2026-48054 is a HIGH (CVSS 8.8) openzeppelin contracts wizard has code vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting @openzeppelin/wizard libraries in the npm ecosystem. The issue involves openzeppelin contracts wizard has code injection in generated hardhat and foundry tests via unsanitized opts.name / opts.uri. Remediation is available by upgrading affected packages to version 0.10.9.

CVE-2026-48054 at a Glance

CVE Identifier CVE-2026-48054
GHSA Identifier GHSA-4x76-22x2-rx8v
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product @openzeppelin/wizard
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 8.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).

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

How to Fix CVE-2026-48054

To remediate this vulnerability, upgrade all affected @openzeppelin/wizard dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@openzeppelin/wizard fixed: 0.10.9
npm install @openzeppelin/wizard@0.10.9
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @openzeppelin/wizard

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-48054, inspect your project dependencies using npm:

npm ls @openzeppelin/wizard

Analyze the terminal output to locate any version of @openzeppelin/wizard in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.10.9), your application is affected.

Note: The npm ls @openzeppelin/wizard command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In @openzeppelin/wizard, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## 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/wizard` via the documented public API:** not affected. The vulnerable functions (`zipHardhat`, `zipFoundry`) are not part of the package's documented public exports. - **Callers of `zipHardhat` / `zipFoundry` who forward externally-controlled strings into `opts.name` / `opts.uri`:** upgrade to `0.10.9`. ## Patches Fixed in `@openzeppelin/wizard@0.10.9`.

CVE-2026-48054 Affected @openzeppelin/wizard Versions

1 component(s)
Fixed Versions:
0.10.9
Product / Package Ecosystem Affected Versions Fixed Version
@openzeppelin/wizard
npm
< 0.10.9
0.10.9

References

Frequently Asked Questions

What is CVE-2026-48054?
CVE-2026-48054 is a security vulnerability in @openzeppelin/wizard involving OpenZeppelin Contracts Wizard has Code Injection in Generated Hardhat and Foundry Tests via Unsanitized opts.name / opts.uri under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which @openzeppelin/wizard versions are affected?
Affected versions include releases prior to 0.10.9 across affected packages: @openzeppelin/wizard.
What version fixes CVE-2026-48054?
Upgrading to 0.10.9 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @openzeppelin/wizard affected?
Yes, @openzeppelin/wizard is affected in releases prior to 0.10.9. Upgrade your dependency to 0.10.9 or later.
What is the CVSS score of CVE-2026-48054?
CVE-2026-48054 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-48054?
CVE-2026-48054 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check npm dependencies for CVE-2026-48054?
Run the dependency tree command: 'npm ls @openzeppelin/wizard'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-4x76-22x2-rx8v",
  "modified" : "2026-06-11T13:27:24Z",
  "published" : "2026-06-11T13:27:24Z",
  "aliases" : [ "CVE-2026-48054" ],
  "summary" : "OpenZeppelin Contracts Wizard has Code Injection in Generated Hardhat and Foundry Tests via Unsanitized opts.name / opts.uri",
  "details" : "## Summary\n\nThe 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.\n\n## Impact\n\n- **Users of the hosted Wizard at https://wizard.openzeppelin.com:** no action required. The site has been redeployed with the fix.\n- **Users of `@openzeppelin/wizard` via the documented public API:** not affected. The vulnerable functions (`zipHardhat`, `zipFoundry`) are not part of the package's documented public exports.\n- **Callers of `zipHardhat` / `zipFoundry` who forward externally-controlled strings into `opts.name` / `opts.uri`:** upgrade to `0.10.9`.\n\n## Patches\n\nFixed in `@openzeppelin/wizard@0.10.9`.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@openzeppelin/wizard"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.10.9"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.10.8"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/OpenZeppelin/contracts-wizard/security/advisories/GHSA-4x76-22x2-rx8v"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/OpenZeppelin/contracts-wizard/commit/ec12c44f8d9e0491eba31037f95b36e98ec58b5f"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/OpenZeppelin/contracts-wizard"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/OpenZeppelin/contracts-wizard/releases/tag/%40openzeppelin%2Fwizard%400.10.9"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-11T13:27:24Z",
    "nvd_published_at" : null
  }
}