CVE-2026-119027
published high CVSS 4.0 · 7.7oapi-codegen 2.5.0 before 2.8.1 Code Injection via servers[].x-go-name Extension
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| oapi-codegen | — | oapi-codegen2.5.0 to < 2.8.1 · Other versions: unaffected | Affected | Not stated | VulnCheck |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 4.0
- Base score
- 7.7 / 10
- Severity
- high
- Provider
- VulnCheck · cna
- Vector string
- 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
Additional Assessments
| Version | Score | Severity | Provider | Vector | Scenarios |
|---|---|---|---|---|---|
| 3.1 | 7.5 | high | VulnCheck · cna | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H | — |
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| oapi-codegen | oapi-codegen | 2.5.0 to < 2.8.1 (affected · semver)Default: unaffected | VulnCheck · cna |
Weaknesses
1- CWE-94 Improper Control of Generation of Code ('Code Injection')
References
8- https://github.com/oapi-codegen/oapi-codegen/blob/v2.5.0/pkg/codegen/templates/server-urls.tmpl#L4-L5
- https://github.com/oapi-codegen/oapi-codegen/blob/v2.8.0/pkg/codegen/templates/server-urls.tmpl#L5-L7
- Patch Commit https://github.com/oapi-codegen/oapi-codegen/commit/068f1bcd16e4724c72d78d6774008a877b8297b1
- Pull Request #2626 https://github.com/oapi-codegen/oapi-codegen/pull/2626
- oapi-codegen v2.8.1 Release Notes https://github.com/oapi-codegen/oapi-codegen/releases/tag/v2.8.1
- GitHub Security Advisory (GHSA-g2vv-83pm-v2hc) https://github.com/oapi-codegen/oapi-codegen/security/advisories/GHSA-g2vv-83pm-v2hc
- GitHub Security Advisory (GHSA-rjwr-m7qx-3fjr) https://github.com/oapi-codegen/oapi-codegen/security/advisories/GHSA-rjwr-m7qx-3fjr
- VulnCheck Advisory: oapi-codegen 2.5.0 before 2.8.1 Code Injection via servers[].x-go-name Extension https://www.vulncheck.com/advisories/oapi-codegen-2.5.0-before-2.8.1-code-injection-via-servers-x-go-name-extension
Provider assertions
2VulnCheck · cna
oapi-codegen 2.5.0 before 2.8.1 Code Injection via servers[].x-go-name Extension
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 0a220007c8ea9014380fd5686d8e67901992fec30a867a1675c8b8e21b908636
- Ingested
- 29 Oct 2026, 17:24:31 UTC
- Source record
- Official CVE record