CVE-2026-119028 PUBLISHED

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

Assigner: VulnCheck
Reserved: 29.10.2026 Published: 29.10.2026 Updated: 29.10.2026

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.

Metrics

CVSS Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
CVSS Score: 8.7

Product Status

Vendor oapi-codegen
Product oapi-codegen
Versions Default: unaffected
  • affected from 2.0.0 to 2.8.1 (excl.)

Credits

  • Zachariah Mithani (AploSec) finder

References

Problem Types

  • Improper Control of Generation of Code ('Code Injection') CWE