AploSec / Disclosures / CVE-2026-119028

High 8.7ReportedFixed in 2.8.1CWE-94Go

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

CVE-2026-119028 · published 2026-10-29

In plain words: this type of bug lets someone run their own code inside the application (code injection). A fixed release is listed.

Summary

CVE-2026-119028 affects oapi-codegen (Go) >= 2.0.0, < 2.8.1: Code injection via non-string enum values (CWE-94). Fixed in 2.8.1. CVSS 4.0 base score 8.7 (High), assigned by VulnCheck. Published 2026-10-29 by VulnCheck. Credit: Zachariah Mithani.

oapi-codegen 2.0.0 before 2.8.1 contains a code injection vulnerability: a non-literal enum entry in an integer, number or boolean schema closes the const block in constants.tmpl and injects a func init(), so an attacker who controls an OpenAPI document executes code when the generated package is built and imported.

Evidence

Reported to the maintainer. The public advisory and references below describe the evidence and preconditions; reporting status alone does not establish independent reproduction.

Remediation

Upgrade oapi-codegen to 2.8.1 or later. Releases in the affected range (>= 2.0.0, < 2.8.1) are vulnerable. See the linked advisory for details on affected release lines.

Timeline

  • 2026-10-29 CVE published
  • 2026-10-31 Public record last updated

References

Severity
High 8.7CVSS 4.0, scored by VulnCheck in the CVE record
Package
oapi-codegen
Ecosystem
Go
Affected
>= 2.0.0, < 2.8.1
Fixed
2.8.1
Weakness
CWE-94
CNA
VulnCheck
Credit
Zachariah Mithanifinder