oapi-codegen 2.5.0 before 2.8.1 Code Injection via servers[].x-go-name Extension
- Published
- Last modified
- Where the record stands: published, rejected by its publisher, or superseded by another id.What do these mean? →
- published
- Whether CISA lists it in its Known Exploited Vulnerabilities catalog: proof that attackers are using it.What do these mean? →
- Not listed in CISA KEV
- Fix
- Fixed in 2.8.1
- Whether working attack code is public (Exploit-DB, Metasploit, Nuclei or GitHub). Public code makes attacks easier.What do these mean? →
- None on Exploit-DB, Metasploit or GitHub
- Exploitation: none
- Automatable: no
- Technical impact: total
Summary
oapi-codegen, a tool that generates Go code from OpenAPI specifications, is affected. An attacker who can supply a crafted OpenAPI document can inject arbitrary Go code into the generated output, which then runs when the affected package is built and imported.
Summarized by anthropic/claude-haiku-5.5. Verify details against the original sources.
Read the original description
oapi-codegen 2.5.0 before 2.8.1 contains a code injection vulnerability that allows attackers to inject Go code by supplying a crafted servers[].x-go-name value emitted unescaped by the server-urls template. Attackers who control an OpenAPI document can define an injected func init() that executes when the victim builds and imports the generated package.
Timeline
- CVE published
- First seen by cve.now
- CISA SSVC assessment
Exploitation: none · Automatable: no · Technical impact: total
- Record last updated
Affected versions
- oapi-codegen oapi-codegen
From 2.5.0 · fixed in 2.8.1