oapi-codegen 2.0.0 before 2.8.1 contains a code injection vulnerability that allows attackers to inject Go code by
Affects oapi-codegenSource GCVE Database
Not known to be exploited · CVSS 8.7 High : upgrade to 2.8.1 soon.
Data as of 29 Oct 2026, 13:34 UTC
Thin evidence
One scorer or none| CNA (VulnCheck) | CVSS 4.0 | 8.7 |
|---|---|---|
| CNA (VulnCheck) | CVSS 3.1 | 8.8 |
- Patch
- Available – fixed in 2.8.1
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:NExploitation evidence
Disclosed: evidence found.
CVE published 29 Oct 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 29 Oct 2026.
What to do
Upgrade github.com/oapi-codegen/oapi-codegen to 2.8.1.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
Gogithub.com/oapi-codegen/oapi-codegenpkg:golang/github.com/oapi-codegen/oapi-codegenOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
A fix is available in oapi-codegen version 2.8.1 and later. Users should upgrade to version 2.8.1 or newer to remediate this vulnerability. There is no indication that any temporary or alternative mitigations exist. No cloud service is involved, so remediation depends on applying the patch.
Description
oapi-codegen versions from 2.0.0 up to but not including 2.8.1 contain a code injection vulnerability. This flaw allows attackers who control an OpenAPI document to inject arbitrary Go code by supplying non-literal enum entries in integer, number, or boolean schemas. The injected code executes during the build and import of the generated package, potentially leading to full compromise.
References
- github.com/oapi-codegen/oapi-codegen/security/advisories/GHSA-g2vv-83pm-v2hc (opens in a new tab)
- github.com/oapi-codegen/oapi-codegen/security/advisories/GHSA-xrqw-w576-xgj2 (opens in a new tab)
- nvd.nist.gov/vuln/detail/CVE-2026-119028 (opens in a new tab)
- github.com/oapi-codegen/oapi-codegen/pull/2626 (opens in a new tab)
- github.com/oapi-codegen/oapi-codegen/commit/068f1bcd16e4724c72d78d6774008a877b8297b1 (opens in a new tab)
- github.com/oapi-codegen/oapi-codegen/blob/v2.0.0/pkg/codegen/templates/constants.tmpl (opens in a new tab)
- github.com/oapi-codegen/oapi-codegen/blob/v2.8.0/pkg/codegen/templates/constants.tmpl (opens in a new tab)
- github.com/oapi-codegen/oapi-codegen/releases/tag/v2.8.1 (opens in a new tab)
- vulncheck.com/advisories/oapi-codegen-2.0.0-before-2.8.1-code-injection-via-non-string-enum-values (opens in a new tab)