Code Injection Vulnerability in oapi-codegen Products by OpenAPI
CVE-2026-119028

8.7HIGH

Key Information:

Vendor
CVE Published:
29 October 2026

What is CVE-2026-119028?

oapi-codegen versions prior to 2.8.1 are vulnerable to code injection through non-literal enum entries in integer, number, or boolean schemas. An attacker with control over an OpenAPI document can exploit this vulnerability by crafting an enum entry that improperly closes the constant block in constants.tmpl. This allows the injection of a 'func init()' function, which executes arbitrary code when the impacted package is built and imported. This vulnerability presents significant risks in environments where oapi-codegen is utilized, enabling potential remote code execution without user consent.

Affected Version(s)

oapi-codegen 2.0.0 < 2.8.1

References

CVSS V4

Score:
8.7
Severity:
HIGH
Confidentiality:
High
Integrity:
High
Availability:
High
Attack Vector:
Network
Attack Complexity:
Low
Attack Required:
None
Privileges Required:
Undefined
User Interaction:
Unknown

Timeline

  • Vulnerability published

  • Vulnerability Reserved

Credit

Zachariah Mithani (AploSec)
.