oapi-codegen 2.0.0 版前 2.8.1 的非字串 Enum 值導致 Go 程式碼注入漏洞
CVE-2026-119028 - oapi-codegen 2.0.0 before 2.8.1 Code Injection via Non-String Enum Values
導語:oapi-codegen 2.0.0 版前 2.8.1 之非字串 Enum 值導致 Go 程式碼注入漏洞,允許攻擊者透過 OpenAPI 檔案注入任意 Go 程式碼。
此漏洞允許攻擊者透過 OpenAPI 檔案注入 Go 程式碼,影響多版本 oapi-codegen,提醒開發者即時升級或驗證生成程式碼。
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.
Impact
Affected Products
The following products are affected by CVE-2026-119028
vulnerability.
Even if cvefeed.io is aware of the exact versions of the
products
that
are
affected, the information is not represented in the table below.
No affected product recoded yet
The Common Vulnerability Scoring System is a standardized framework for assessing the severity of vulnerabilities in software and systems. We collect and displays CVSS scores from various sources for each CVE.
| Score | Version | Severity | Vector | Exploitability Score | Impact Score | Source |
|---|---|---|---|---|---|---|
| CVSS 3.1 | HIGH | 83251b91-4cc7-4094-a5c7-464a1b83ea10 | ||||
| CVSS 3.1 | HIGH | MITRE-CVE | ||||
| CVSS 4.0 | HIGH | 83251b91-4cc7-4094-a5c7-464a1b83ea10 |
Update oapi-codegen to version 2.8.1 or later to fix a code injection vulnerability.
- Update oapi-codegen to version 2.8.1 or later.
- Validate generated code for suspicious entries.
- Review OpenAPI documents for malicious enum entries.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2026-119028 vulnerability anywhere in the article.
EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days. Following chart shows the EPSS score history of the vulnerability.