AploSec / Disclosures / CVE-2026-119027

High 7.7ReportedFixed in 2.8.1CWE-94Go

oapi-codegen 2.5.0 before 2.8.1 Code Injection via servers[].x-go-name Extension

CVE-2026-119027 · published 2026-10-29

In plain words: this type of bug lets someone run their own code inside the application (code injection). A fixed release is listed.

Summary

CVE-2026-119027 affects oapi-codegen (Go) >= 2.5.0, < 2.8.1: Code injection via servers[].x-go-name extension (CWE-94). Fixed in 2.8.1. CVSS 4.0 base score 7.7 (High), assigned by VulnCheck. Published 2026-10-29 by VulnCheck. Credit: Zachariah Mithani.

oapi-codegen 2.5.0 before 2.8.1 contains a code injection vulnerability: a crafted servers[].x-go-name value is emitted unescaped by the server-urls template, so an attacker who controls an OpenAPI document can define an injected func init() that executes when the victim builds and imports the generated package.

Evidence

Reported to the maintainer. The public advisory and references below describe the evidence and preconditions; reporting status alone does not establish independent reproduction.

Remediation

Upgrade oapi-codegen to 2.8.1 or later. Releases in the affected range (>= 2.5.0, < 2.8.1) are vulnerable. See the linked advisory for details on affected release lines.

Timeline

  • 2026-10-29 CVE published
  • 2026-10-31 Public record last updated

References

Severity
High 7.7CVSS 4.0, scored by VulnCheck in the CVE record
Package
oapi-codegen
Ecosystem
Go
Affected
>= 2.5.0, < 2.8.1
Fixed
2.8.1
Weakness
CWE-94
CNA
VulnCheck
Credit
Zachariah Mithanifinder