CVE-2026-119027: oapi-codegen code injection in server URL template

CVE-2026-119027 · Severity: high · CVSS 7.5 · Published 2026-10-29

oapi-codegen is a tool that generates Go server code from OpenAPI specifications. Versions 2.5.0 through 2.8.0 contain a code injection flaw that allows an attacker who controls an OpenAPI document to inject arbitrary Go code, including initialization functions that execute when the generated code is built and imported. This can lead to supply chain attacks where malicious code executes in any application that uses the generated package.

Technologies: Oapi-Codegen. Vendors: Oapi-Codegen.

Quick answers

Is CVE-2026-119027 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-119027 being exploited in the wild.
How severe is CVE-2026-119027?
High severity, with a CVSS score of 7.5, published 29 October 2026.
Which products and versions are affected?
Oapi-Codegen 2.5.0 through 2.8.0.
Is there a fix for CVE-2026-119027?
Yes: fixed in 2.8.1. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-119027 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-119027?
Check whether you run Oapi-Codegen at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • Fixed in: 2.8.1

Technical details

The vulnerability is a code injection flaw in the server-urls.tmpl template, where the servers[].x-go-name field is emitted unescaped into generated Go code. An attacker can supply a crafted OpenAPI document with a malicious x-go-name value containing Go code such as a func init() block, which will be incorporated unescaped into the generated source. The injected code executes when the generated package is compiled and imported by a victim. This requires the attacker to control the OpenAPI document, but does not require network access or authentication from the user.

Affected products

  • oapi-codegen oapi-codegen 2.5.0 through 2.8.0

Timeline

  • 2026-10-29: disclosed

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.