Code injection in oapi-codegen via non-string enum values
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Passive
- Attack complexity
- Low
- Attack requirements
- None
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 4.0 · CNA. Fix status from CNA. Impact type from CWE-94.
Summary
oapi-codegen from 2.0.0 before 2.8.1 contains a code injection flaw (CWE-94) in how it handles non-literal enum entries in integer, number, or boolean schemas. An attacker who controls an OpenAPI document can inject Go code that runs when the generated package is built and imported.
Written with Claude Haiku 5.5 from the sources below · 2026-11-06
Description from the CNA
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| oapi-codegen | oapi-codegen | 2.0.0 to before 2.8.1 | 2.8.1 | Patch available | CNA |
- oapi-codegen Vendoroapi-codegen Affected 2.0.0 to before 2.8.1 Fixed in 2.8.1 Patch available CNA
Remediation
Upgrade oapi-codegen to version 2.8.1, which fixes this flaw.
Written with Claude Haiku 5.5 from the sources below · 2026-11-06
- Fix · CNA oapi-codegen (oapi-codegen) Fixed in 2.8.1
Fixed in the same release
Records fixed by the same vendor advisory or release, as the CNA lists them.
- Advisory ·
oapi-codegen — GitHub Security Advisory (GHSA-g2vv-83pm-v2hc)
2 records Highest priority Priority MEDIUM 1 MEDIUM, 1 LOW
Other records, highest priority first
- TI-2026-82375 Code injection in oapi-codegen via servers x-go-name extensionPriority LOW 36
Vendor assessments
Timeline
- 2026-10-29 Threatist record created from CVE-2026-119028
- 2026-10-29 Alias added: GHSA-qf68-jmvg-6fww
- 2026-10-29 CISA SSVC decision points changed
- 2026-10-29 Priority changed: MEDIUM → LOW
- 2026-10-31 Priority changed: LOW → MEDIUM
- 2026-11-06 Affected versions changed · Red Hat
- 2026-11-06 CVSS score added · Red Hat
References
Advisory 2
More oapi-codegen vulnerabilities
- TI-2026-82375 Code injection in oapi-codegen via servers x-go-name extension CVSS 4.0HIGH 7.7
Sources
- CVE-2026-119028 · CVE Program
- CVE-2026-119028 · NVD
- FIRST EPSS
- GHSA-qf68-jmvg-6fww · GitHub Advisory Database · CC BY 4.0
- CVE-2026-119028 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences