CVE-2026-119027

Description

A flaw was found in oapi-codegen. An attacker who supplies a crafted OpenAPI specification can achieve arbitrary code execution on systems that build or run the generated code. The vulnerability exists because server configuration properties are emitted unescaped into Go code templates, allowing malicious Go code to be injected into the generated output. When a victim imports or compiles the generated package, the injected code automatically executes.

Statement

This vulnerability is rated as Important severity because successful exploitation can result in arbitrary code execution within developer systems or automated CI/CD pipelines. An attacker must persuade a user or pipeline to process a crafted OpenAPI definition, but once the compromised Go code is produced, malicious routines execute automatically upon compilation or import. In Red Hat environments, oapi-codegen functions as an offline development utility rather than an exposed network daemon, restricting the attack vector to build-time workflows that consume untrusted third-party schemas.

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

Want to get errata notifications? Sign up here.