CVE-2026-119028
Description
A flaw was found in oapi-codegen. This vulnerability allows an attacker who controls an OpenAPI specification to achieve arbitrary code execution by supplying crafted enum entries in integer, number, or boolean schemas. When processing the untrusted specification, the generator fails to sanitize these values, allowing injected code to execute when the generated Go package is built or imported.
Statement
This vulnerability is rated as an Important severity flaw because successful exploitation allows arbitrary code execution with the privileges of the local user or build environment compiling the generated code. Because oapi-codegen is primarily utilized as a build-time code generator rather than an exposed runtime service, exploitation requires an attacker to induce a developer or automated build pipeline to ingest a malicious OpenAPI specification. Consequently, production workloads are not directly exposed over the network unless untrusted API definitions are dynamically consumed during build or deployment processes.
Understanding the Weakness (CWE)
Access Control
Technical Impact: Bypass Protection Mechanism
In some cases, injectable code controls authentication; this may lead to a remote vulnerability.
Access Control
Technical Impact: Gain Privileges or Assume Identity
Injected code can access resources that the attacker is directly prevented from accessing.
Integrity,Confidentiality,Availability
Technical Impact: Execute Unauthorized Code or Commands
When a product allows a user's input to contain code syntax, it might be possible for an attacker to craft the code in such a way that it will alter the intended control flow of the product. As a result, code injection can often result in the execution of arbitrary code. Code injection attacks can also lead to loss of data integrity in nearly all cases, since the control-plane data injected is always incidental to data recall or writing.
Non-Repudiation
Technical Impact: Hide Activities
Often the actions performed by injected control code are unlogged.
Frequently Asked Questions
Not sure what something means? Check out our Security Glossary.
Want to get errata notifications? Sign up here.