{"id":"CVE-2026-127208","aliases":["CVE-2026-127208"],"related":[],"kind":"vulnerability","state":"published","title":"datamodel-code-generator < 0.84.0 Code Injection via x-python-type Annotation","summary":"datamodel-code-generator before 0.84.0 contains a code injection vulnerability that allows attackers to achieve arbitrary code execution by supplying a malicious JSON Schema with a crafted x-python-type annotation containing a string ast.Constant node in a subscript slice position, which bypasses validation in parse_python_type_annotation and _python_type_expr_from_ast. Attackers can embed malicious Python expressions such as __import__ calls within quoted string literals in the generated source code, which Pydantic v2 evaluates as a ForwardRef via eval() during model_rebuild(), resulting in arbitrary code execution on developer workstations, CI/CD pipelines, or applications that generate and import the produced models at runtime.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"datamodel-code-generator before 0.84.0 contains a code injection vulnerability that allows attackers to achieve arbitrary code execution by supplying a malicious JSON Schema with a crafted x-python-type annotation containing a string ast.Constant node in a subscript slice position, which bypasses validation in parse_python_type_annotation and _python_type_expr_from_ast. Attackers can embed malicious Python expressions such as __import__ calls within quoted string literals in the generated source code, which Pydantic v2 evaluates as a ForwardRef via eval() during model_rebuild(), resulting in arbitrary code execution on developer workstations, CI/CD pipelines, or applications that generate and import the produced models at runtime.","source":"cvelist"}],"published":"2026-11-12T20:58:59.634Z","modified":"2026-11-13T17:17:26.743Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","score":8.6,"rating":"HIGH"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","score":8.6,"rating":"HIGH"},{"scorer":"VulnCheck","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"}],"cwes":["CWE-94"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"0.84.0","status":"affected"}],"vendor":"datamodel-code-generator","product":"datamodel-code-generator","repo":"https://github.com/datamodel-code-generator/datamodel-code-generator","source":"cvelist"}],"references":[{"url":"https://github.com/datamodel-code-generator/datamodel-code-generator/releases/tag/0.84.0","tags":["release-notes"],"sources":["cvelist","nvd"]},{"url":"https://github.com/datamodel-code-generator/datamodel-code-generator/commit/ebfc11d0644d37a71374b28aac06d98748e584ec","tags":["issue-tracking","patch"],"sources":["cvelist","nvd"]},{"url":"https://www.vulncheck.com/advisories/datamodel-code-generator-code-injection-via-x-python-type-annotation","tags":["third-party-advisory"],"sources":["cvelist","nvd"]}],"credits":["Enrik Mustafa"],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-11-13T15:34:54.409Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-127208","url":"https://www.cve.org/CVERecord?id=CVE-2026-127208","licence":"CVE Terms of Use","modified":"2026-11-13T16:04:00.401Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-127208","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-127208","licence":"Public domain","modified":"2026-11-13T17:17:26.743Z"}],"updatedAt":"2026-11-25T22:59:50.566Z","epss":{"score":0.00465,"percentile":0.41958,"date":"2026-12-01T12:00:22.000Z"}}