Sceawere
Vulnerability Detail
CVE-2026-57583UPDATED Verified Sceawere Triage Sources: NVD / CISA KEV
Wizard Code Injection Vulnerability
Vulnerability Metadata
- Severity
- Low
- Score / CVSS
- 3.3
- Creation Date
- 3h ago
- Vendor
- OpenZeppelin
- Product
- contracts-wizard
- Attack Type
- CWE-94: Improper Control of Generation of Code ('Code Injection')
- Vector String
- CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N
- Attack Complexity
- LOW
Narrative and Response
Description
OpenZeppelin Contracts Wizard is a web application to interactively build a contract out of components from OpenZeppelin Contracts. Prior to @openzeppelin/wizard 0.10.11, @openzeppelin/wizard-cairo 3.0.1, @openzeppelin/wizard-stellar 0.6.2, and @openzeppelin/wizard-stylus 0.3.1, the setInfo code path prints info.securityContact and info.license verbatim into single-line comments in generated Solidity, Cairo, Stellar/Soroban, and Stylus source. A line terminator ends the comment and causes following input to be emitted as source declarations. Exploitation requires an integration to populate these fields from untrusted input and a user to consume the generated source; normal self-service web, AI assistant, CLI, and self-hosted API use does not cross that trust boundary, shared links cannot set the fields, and no code executes on a Wizard service. This issue affects generated-source integrity only and is fixed in versions 0.10.11, 3.0.1, 0.6.2, and 0.3.1 of the respective packages.
Executive Summary
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Technical Details
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Mitigations
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
References
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Additional Metadata
{
"score": "3.3",
"pubDate": "2026-09-14T18:17:58.720Z",
"pubdate": "2026-09-14T18:17:58.720Z",
"executiveSummary": "The OpenZeppelin Contracts Wizard contains a code injection vulnerability arising from improper neutralization of input within the setInfo code path. This flaw affects versions prior to @openzeppelin/wizard 0.10.11, @openzeppelin/wizard-cairo 3.0.1, @openzeppelin/wizard-stellar 0.6.2, and @openzeppelin/wizard-stylus 0.3.1. The vulnerability allows an attacker to break out of single-line comment structures by injecting line terminators into the securityContact or license fields.\nThe primary impact is a loss of generated-source integrity. If a third-party integration populates these fields using untrusted user input, an attacker can append arbitrary source code or declarations to the generated contract files. This effectively allows for the injection of malicious logic into smart contracts, which may subsequently be deployed to blockchain networks. Exploitation requires the presence of an integration that accepts untrusted external input and relies on the user to compile and deploy the compromised output. The vulnerability does not allow remote code execution against the Wizard service itself, and standard use cases such as the official web interface or AI assistants are not inherently vulnerable unless they facilitate this untrusted integration.",
"technicalDetails": "The root cause of this vulnerability is the lack of input sanitization within the setInfo function, which handles the generation of metadata comments in source code across multiple languages (Solidity, Cairo, Stellar/Soroban, and Stylus). When users define a securityContact or license string, the Wizard service concatenates these values directly into the output following a single-line comment delimiter (e.g., //).\nBecause the application fails to filter or escape line terminator characters (such as \\n or \\r), an attacker can inject these characters to terminate the comment block prematurely. Once the comment block is terminated, subsequent characters provided in the input are interpreted by the compiler as valid language-specific source code declarations rather than comments.\nThe attack flow follows this process: First, an attacker supplies a malicious string containing a line terminator, followed by syntactically correct code for the target language (e.g., adding an arbitrary contract function or state variable). Second, this input must be passed to the vulnerable Wizard package through an integration—such as a web application or API that generates smart contracts based on parameters supplied by third parties. Third, the Wizard package produces a corrupted source file where the injected code appears outside the intended comment context. Finally, when a victim compiles and deploys this generated source, the injected logic is executed as part of the smart contract's operational lifecycle.\nThe vulnerable component is the metadata injection logic within the @openzeppelin/wizard, @openzeppelin/wizard-cairo, @openzeppelin/wizard-stellar, and @openzeppelin/wizard-stylus packages. Because the issue is isolated to the generation of source code, it does not pose a risk to the Wizard service itself or the infrastructure hosting it. The exploit strictly targets the integrity of the generated artifacts. Successful exploitation results in the creation of smart contracts with altered, potentially malicious, logic, which can lead to financial loss or security failure if the output is deployed without code review. Since standard self-service uses (web, CLI, AI) do not allow for the traversal of the untrusted boundary required to execute the injection, the attack surface is limited to automated integrations that perform programmatic generation using untrusted metadata inputs."
}