---
title: "CVE-2026-119027: oapi-codegen - Code Injection"
description: "oapi-codegen > 2.5.0 and < 2.8.1 contains a code injection vulnerability caused by unescaped servers[].x-go-name value in server-urls template, letting attackers inject Go code executed during package build, exploit requires attacker control of OpenAPI document."
url: https://panop.io/threat-heartbeat/CVE-2026-119027/
---

# CVE-2026-119027 oapi-codegen - Code Injection

oapi-codegen > 2.5.0 and < 2.8.1 contains a code injection vulnerability caused by unescaped servers\[\].x-go-name value in server-urls template, letting attackers inject Go code executed during package build, exploit requires attacker control of OpenAPI document.

CVSS base score 7.5 /10

High

CISA KEV

Not listed

Public exploit

None known

Authentication

Not required

EPSS

0.39% chance of exploitation in 30 days

[View the NVD record ↗](https://nvd.nist.gov/vuln/detail/CVE-2026-119027)

## Details

Type

Code Injection

Impact

Remote Code Execution

CVSS vector

CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H

Published

29 October 2026

Updated

31 October 2026

Weakness

[CWE-94](https://cwe.mitre.org/data/definitions/94.html)

## Vendor fix

Upgrade to version 2.8.1 or later.

Patching closes this CVE. It does not tell you which of your systems run the affected version, or what else is exposed alongside them.

## References

- [https://nvd.nist.gov/vuln/detail/CVE-2026-119027](https://nvd.nist.gov/vuln/detail/CVE-2026-119027)
- [https://www.vulncheck.com/advisories/oapi-codegen-2.5.0-before-2.8.1-code-injection-via-servers-x-go-name-extension](https://www.vulncheck.com/advisories/oapi-codegen-2.5.0-before-2.8.1-code-injection-via-servers-x-go-name-extension)
- [https://github.com/oapi-codegen/oapi-codegen/blob/v2.5.0/pkg/codegen/templates/server-urls.tmpl#L4-L5](https://github.com/oapi-codegen/oapi-codegen/blob/v2.5.0/pkg/codegen/templates/server-urls.tmpl#L4-L5)
- [https://github.com/oapi-codegen/oapi-codegen/blob/v2.8.0/pkg/codegen/templates/server-urls.tmpl#L5-L7](https://github.com/oapi-codegen/oapi-codegen/blob/v2.8.0/pkg/codegen/templates/server-urls.tmpl#L5-L7)
- [https://github.com/oapi-codegen/oapi-codegen/commit/068f1bcd16e4724c72d78d6774008a877b8297b1](https://github.com/oapi-codegen/oapi-codegen/commit/068f1bcd16e4724c72d78d6774008a877b8297b1)
- [https://github.com/oapi-codegen/oapi-codegen/pull/2626](https://github.com/oapi-codegen/oapi-codegen/pull/2626)
- [https://github.com/oapi-codegen/oapi-codegen/releases/tag/v2.8.1](https://github.com/oapi-codegen/oapi-codegen/releases/tag/v2.8.1)
- [https://github.com/oapi-codegen/oapi-codegen/security/advisories/GHSA-g2vv-83pm-v2hc](https://github.com/oapi-codegen/oapi-codegen/security/advisories/GHSA-g2vv-83pm-v2hc)
- [https://github.com/oapi-codegen/oapi-codegen/security/advisories/GHSA-rjwr-m7qx-3fjr](https://github.com/oapi-codegen/oapi-codegen/security/advisories/GHSA-rjwr-m7qx-3fjr)

[← All CVEs](https://panop.io/threat-heartbeat/)

## What this record can't tell you

- Whether you run the affected software, and where
- Whether an attacker can actually reach and exploit it
- The misconfigurations that never get a CVE number
- What it would cost the business, ranked into what to fix first

Panop answers these inside your environment, for this CVE and every other finding.

[Book a demo](https://panop.io/demo)
