Read the docs

Code injection in oapi-codegen via non-string enum values

Priority MEDIUM 40CWE-94Published · Updated

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

Exploitation None reported CISA SSVC · not in CISA KEV
EPSS 0.00422 36th percentileScored 2026-11-07
Fix Fixed oapi-codegen (oapi-codegen): 2.8.1

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

VendorProductAffected versionsFixed inStatusSource
oapi-codegenoapi-codegen2.0.0 to before 2.8.12.8.1Patch availableCNA
  • 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

Red Hat

Red Hat's page for this CVE →

Not affected: 1 product
  • Red Hat

Timeline

  1. 2026-10-29 Threatist record created from CVE-2026-119028
  2. 2026-10-29 Alias added: GHSA-qf68-jmvg-6fww
  3. 2026-10-29 CISA SSVC decision points changed
  4. 2026-10-29 Priority changed: MEDIUM → LOW
  5. 2026-10-31 Priority changed: LOW → MEDIUM
  6. 2026-11-06 Affected versions changed · Red Hat
  7. 2026-11-06 CVSS score added · Red Hat

References

  • TI-2026-82375 Code injection in oapi-codegen via servers x-go-name extension CVSS 4.0HIGH 7.7

Sources