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.

Project Subscriptions

Vendors Products
Oapi-codegen Subscribe
Oapi-codegen Subscribe
Advisories

No advisories yet.

Fixes

Solution

No solution given by the vendor.


Workaround

No workaround given by the vendor.

History

Fri, 30 Oct 2026 23:45:00 +0000

Type Values Removed Values Added
First Time appeared Oapi-codegen
Oapi-codegen oapi-codegen
Vendors & Products Oapi-codegen
Oapi-codegen oapi-codegen

Thu, 29 Oct 2026 15:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Thu, 29 Oct 2026 11:45:00 +0000

Type Values Removed Values Added
Description 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.
Title oapi-codegen 2.0.0 before 2.8.1 Code Injection via Non-String Enum Values
Weaknesses CWE-94
References
Metrics cvssV3_1

{'score': 8.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'}

cvssV4_0

{'score': 8.7, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N'}


Projects

Sign in to view the affected projects.

cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-10-29T14:08:24.785Z

Reserved: 2026-10-29T11:32:05.290Z

Link: CVE-2026-119028

cve-icon Vulnrichment

Updated: 2026-10-29T14:08:15.499Z

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-10-29T12:17:12.310

Modified: 2026-10-29T16:19:37.750

Link: CVE-2026-119028

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-10-30T23:14:48Z

Weaknesses