Code injection in oapi-codegen via servers x-go-name extension
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
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.5.0 to before 2.8.1 | 2.8.1 | Patch available | CNA |
- 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
Timeline
- 2026-10-29 Threatist record created from CVE-2026-119027
- 2026-10-29 Alias added: GHSA-prxp-239m-mh9f
- 2026-10-29 CISA SSVC decision points changed
- 2026-10-29 Priority changed: MEDIUM → LOW
- 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-82376 Code injection in oapi-codegen via non-string enum values CVSS 4.0HIGH 8.7
Sources
- CVE-2026-119027 · CVE Program
- CVE-2026-119027 · NVD
- FIRST EPSS
- GHSA-prxp-239m-mh9f · GitHub Advisory Database · CC BY 4.0
- CVE-2026-119027 · 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