{"id":"CVE-2026-119028","title":"oapi-codegen 2.0.0 before 2.8.1 Code Injection via Non-String Enum Values","summary":"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 c…","severity":"high","cvss":8.8,"cvssVector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","cvssSource":"cna","cwe":["CWE-94"],"vendor":"oapi-codegen","product":"oapi-codegen","affected":["oapi-codegen >= 2.0.0 < 2.8.1"],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2026-10-29T14:08:08.391763Z"},"published":"2026-10-29","updated":"2026-10-29","sourceUpdated":"2026-10-29T14:08:24.785Z","source":"CVEORG","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-119028","references":[{"url":"https://github.com/oapi-codegen/oapi-codegen/security/advisories/GHSA-g2vv-83pm-v2hc","label":"GitHub Security Advisory (GHSA-g2vv-83pm-v2hc)"},{"url":"https://github.com/oapi-codegen/oapi-codegen/pull/2626","label":"Pull Request #2626"},{"url":"https://github.com/oapi-codegen/oapi-codegen/commit/068f1bcd16e4724c72d78d6774008a877b8297b1","label":"Patch Commit"},{"url":"https://github.com/oapi-codegen/oapi-codegen/blob/v2.8.0/pkg/codegen/templates/constants.tmpl#L16"},{"url":"https://github.com/oapi-codegen/oapi-codegen/blob/v2.0.0/pkg/codegen/templates/constants.tmpl#L12"},{"url":"https://github.com/oapi-codegen/oapi-codegen/releases/tag/v2.8.1","label":"oapi-codegen v2.8.1 Release Notes"},{"url":"https://github.com/oapi-codegen/oapi-codegen/security/advisories/GHSA-xrqw-w576-xgj2","label":"GitHub Security Advisory (GHSA-xrqw-w576-xgj2)"},{"url":"https://www.vulncheck.com/advisories/oapi-codegen-2.0.0-before-2.8.1-code-injection-via-non-string-enum-values","label":"VulnCheck Advisory: oapi-codegen 2.0.0 before 2.8.1 Code Injection via Non-String Enum Values"}],"tags":["cve.org"],"epss":0.00422,"epssPercentile":0.36519,"ingestedAt":"2026-11-01T20:00:16.931Z","slug":"CVE-2026-119028","body":"## Overview\n\noapi-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.\n\n## Affected\n\n- `oapi-codegen >= 2.0.0 < 2.8.1`\n\n## Remediation\n\nRefer to the linked advisories for vendor-supplied fixes and affected version ranges.","depth":"twilight","depthScore":48,"depthScoreParts":{"impact":48.4,"likelihood":0.1,"exploitation":0,"ransomware":0},"changes":[]}