Skip to main content
← All vulnerabilities
CVE-2026-119027EUVD-2026-112755GHSA-PRXP-239M-MH9F

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

Published
Last modified
published
Not listed in CISA KEV
Fix
Fixed in 2.8.1
None on Exploit-DB, Metasploit or GitHub
  • Exploitation: none
  • Automatable: no
  • Technical impact: total

Summary

oapi-codegen, a tool that generates Go code from OpenAPI specifications, is affected. An attacker who can supply a crafted OpenAPI document can inject arbitrary Go code into the generated output, which then runs when the affected package is built and imported.

Summarized by anthropic/claude-haiku-5.5. Verify details against the original sources.

Read the original 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.

Timeline

  1. CVE published
  2. First seen by cve.now
  3. CISA SSVC assessment

    Exploitation: none · Automatable: no · Technical impact: total

  4. Record last updated

Affected versions

  • oapi-codegen oapi-codegen

    From 2.5.0 · fixed in 2.8.1

References 8

GitHub · oapi-codegen/oapi-codegen

vulncheck.com