Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1359 CNY

100%

CVE-2026-119028— oapi-codegen 2.0.0 before 2.8.1 Code Injection via Non-String Enum Values

Quick assessment

Affected
oapi-codegen oapi-codegen
Exploitation
No confirmed in-the-wild exploitation; assess based on exposure
Recommended action
Check the vendor advisory and references for a fixed version. If immediate upgrade is impossible, restrict exposure and increase monitoring.

oapi-codegen 2.0.0 至 2.8.1(不含 2.8.1)版本存在代码注入漏洞。攻击者可通过在整数、数字或布尔类型的 Schema 中提供非字面量(non-literal)的枚举项,注入 Go 代码。若攻击者能够控制 OpenAPI 文档,可构造一个枚举项,使 中的 代码块提前闭合,进而注入 函数。该恶意代码将在生成的包被构建并导入时执行。

CVSS 8.8 · High

Possible ATT&CK Techniques 1 AI

T1190 · Exploit Public-Facing Application
Get alerts for future matching vulnerabilities Log in to subscribe

I. Basic Information for CVE-2026-119028

Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
oapi-codegen 2.0.0 before 2.8.1 Code Injection via Non-String Enum Values
Source: CVE Program / CVE List V5
Vulnerability 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.
Source: CVE Program / CVE List V5
CVSS Information
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Source: CVE Program / CVE List V5
Vulnerability Type
对生成代码的控制不恰当(代码注入)
Source: CVE Program / CVE List V5

Affected Products

Vendor Product Affected Versions CPE Subscribe
oapi-codegen oapi-codegen 2.0.0 ~ 2.8.1 -

II. Public POCs for CVE-2026-119028

# POC Description Source Link Shenlong Link
AI-Generated POC Premium

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2026-119028

请登录查看更多情报信息。

Other References for CVE-2026-119028 (8)

IV. Related Vulnerabilities