CVE-2026-119028

published 29 Oct 2026 · updated 29 Oct 2026

oapi-codegen 2.0.0 before 2.8.1 Code Injection via Non-String Enum Values

8.8HighCVSS 8.8EPSS 0%

No exploitation in the wild has been reported. EPSS puts the chance of exploitation in the next 30 days at 0%. Fixed in 2.8.1.

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.

Affected

Vendors, products and packages with version ranges

VendorProductVersionsFixed
oapi-codegen>=2.0.0 <2.8.12.8.1

Timeline

Every event on this vulnerability

Embed

A live severity badge for an advisory, README or ticket

CVE-2026-119028 severity on Zeptric[![CVE-2026-119028](https://zeptric.io/badge/cve/CVE-2026-119028.svg)](https://zeptric.io/cve/CVE-2026-119028)