oapi-codegen 2.0.0 before 2.8.1 Code Injection via Non-String Enum Values
- 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 malicious OpenAPI document could inject arbitrary Go code into the generated output, which would run when the generated 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.0.0 before 2.8.1 contains a code injection vulnerability that allows attackers to inject Go code by supplying non-literal enum entries in integer, number, or boolean schemas. Attackers controlling an OpenAPI document can craft an enum entry that closes the const block in constants.tmpl and injects a func init(), executing code when the generated package is built and imported.
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.0.0 · fixed in 2.8.1