Skip to main content
← All vulnerabilities
CVE-2026-119028EUVD-2026-112756GHSA-QF68-JMVG-6FWW

oapi-codegen 2.0.0 before 2.8.1 Code Injection via Non-String Enum Values

Published
Last modified
published
Not listed in CISA KEV
Fix
Fixed in 2.8.1
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

  1. CVE published
  2. First seen by cve.now
  3. CISA SSVC assessment

    Exploitation: none · Automatable: no · Technical impact: total

  4. Record last updated

Affected versions

  • oapi-codegen oapi-codegen

    From 2.0.0 · fixed in 2.8.1

References 8

GitHub · oapi-codegen/oapi-codegen

vulncheck.com