All vulnerabilities

Go

CVE-2026-119027

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

Severity
High 7.7
Published
29 Oct 2026
Last changed
29 Oct 2026
Added to UpHeron
23 Nov 2026
Fixed in
2.8.1
Exploit chance
0.4% in the next 30 daysHigher than 34% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
Code injection (CWE-94)
Attack
Over the network · Only under certain conditions · No login needed · Needs someone to view a page or file
Attacker can
Read data · Change data · Take it down
CVSS vector
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Sources
CVE Program

Description

oapi-codegen 2.5.0 before 2.8.1 contains a code injection vulnerability that allows attackers to inject Go code by supplying a crafted servers[].x-go-name value emitted unescaped by the server-urls template. Attackers who control an OpenAPI document can define an injected func init() that executes when the victim builds and imports the generated package.

From the CVE Program.

Affected software

SoftwareAffected versions
github.com/oapi-codegen/oapi-codegen/v2Go · osv:Go:github.com/oapi-codegen/oapi-codegen/v2
  • From 2.5.0 before 2.8.1

About github.com/oapi-codegen/oapi-codegen/v2

Vulnerabilities in github.com/oapi-codegen/oapi-codegen/v2

In our list
2
Published in the last 12 months
2
Critical, last 12 months
0
High, last 12 months
2
Known exploited
0
Search the list for github.com/oapi-codegen/oapi-codegen/v2

References

  • CVE.org https://www.cve.org/CVERecord?id=CVE-2026-119027