CVE-2026-119027

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

State
Published
Severity
7.7 High
Published
Oct 29, 2026
Updated
Oct 29, 2026
Reserved
Oct 29, 2026

Read the record on cve.org

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.

Scores

CVSSScoreVectorSource
4.07.7 HighCVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:NVulnCheck
3.17.5 HighCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:HVulnCheck

Weaknesses

  • CWE-94 Improper Control of Generation of Code ('Code Injection')

Affected Products

ProductVersions
oapi-codegenoapi-codegen
  • 2.5.0 to before 2.8.1Affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.