Read the docs

Code injection in oapi-codegen via servers x-go-name extension

Priority LOW 36CWE-94Published · Updated

Key facts

Attack vector
Network
Privileges required
None
User interaction
Passive
Attack complexity
Low
Attack requirements
Present
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.5.0 before 2.8.1 contains a code injection flaw (CWE-94). The server-urls template emits a servers[].x-go-name value unescaped, so a crafted value injects Go code into the generated output. An attacker who controls an OpenAPI document can define a func init() that runs when a victim builds and imports the generated package.

Written with Claude Haiku 5.5 from the sources below · 2026-11-06

Description from the CNA

oapi-codegen 2.5.0 before 2.8.1 contains a code injection vulnerability that allows attackers to inject Go code by supplying a crafted servers[].x-go-name value emitted unescaped by the server-urls template. Attackers who control an OpenAPI document can define an injected func init() that executes when the victim builds and imports the generated package.

Why it matters now

Exploitation None reported CISA SSVC · not in CISA KEV
EPSS 0.00394 33rd 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.5.0 to before 2.8.12.8.1Patch availableCNA
  • oapi-codegen Vendoroapi-codegen Affected 2.5.0 to before 2.8.1 Fixed in 2.8.1 Patch available CNA

Remediation

Upgrade oapi-codegen to version 2.8.1, the fixed version.

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-82376 Code injection in oapi-codegen via non-string enum valuesPriority MEDIUM 40

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-119027
  2. 2026-10-29 Alias added: GHSA-prxp-239m-mh9f
  3. 2026-10-29 CISA SSVC decision points changed
  4. 2026-10-29 Priority changed: MEDIUM → LOW
  5. 2026-11-06 Affected versions changed · Red Hat
  6. 2026-11-06 CVSS score added · Red Hat

References

  • TI-2026-82376 Code injection in oapi-codegen via non-string enum values CVSS 4.0HIGH 8.7

Sources