CVE-2026-119027 PUBLISHED

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

Assigner: VulnCheck
Reserved: 29.10.2026 Published: 29.10.2026 Updated: 29.10.2026

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.

Metrics

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
CVSS Score: 7.7

Product Status

Vendor oapi-codegen
Product oapi-codegen
Versions Default: unaffected
  • affected from 2.5.0 to 2.8.1 (excl.)

Credits

  • Zachariah Mithani (AploSec) finder

References

Problem Types

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