oapi-codegen 2.0.0 before 2.8.1 Code Injection via Non-String Enum Values
Impact
oapi-codegen versions 2.0.0 before 2.8.1 have a code injection vulnerability via non-string enum values in OpenAPI documents. Attackers can inject Go code, executing it when the generated package is built and imported. Affected versions are 2.0.0 to less than 2.8.1.
Summarized by @cf/meta/llama-3.3-70b-instruct-fp8-fast. Verify details against the original sources.Affected packages
Affected products
Vendor version evidence. Product records are separate from automatic dependency matching.
oapi-codegen · VulnCheck
oapi-codegen
1 range
oapi-codegen · VulnCheck
oapi-codegen
Package identity
pkg:golang/github.com/oapi-codegen/oapi-codegen/v2Explore github.com/oapi-codegen/oapi-codegen/v2 →Identity supplied by VulnCheck. Version matching requires compatible range evidence.
Compare with this publisher’s ranges. This does not inspect your installation.
affected
2.0.0 → before 2.8.1
semver versions
Other versions: unaffected
Original source description
oapi-codegen 2.0.0 before 2.8.1 contains a code injection vulnerability that allows attackers to inject Go code by supplying non-literal enum entries in integer, number, or boolean schemas. Attackers controlling an OpenAPI document can craft an enum entry that closes the const block in constants.tmpl and injects a func init(), executing code when the generated package is built and imported.
Inside the record
Evidence available
Describes the evidence in this view, not whether the product is safe.
Original records
CVE-2026-119028View the latest unmodified CVE JSON from the official source. It may be newer than this imported page.
cve.new JSON →Underlying weaknesses
The source’s classification of what caused the vulnerability.
Contributing organizations · 2
Assigning organization
Additional data publisher
What changed
Follow changesLarge field values are marked as truncated previews. Original source snapshots remain retained.