{"id":"CVE-2026-127208","published":"2026-11-12T20:58:59Z","modified":"2026-11-13T16:04:00Z","title":"datamodel-code-generator < 0.84.0 Code Injection via x-python-type Annotation","vendor":"datamodel-code-generator","product":"datamodel-code-generator","tier":"tail","description":{"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":8.8,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00371,"percentile":0.31882,"provenance":"source"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"}],"references":[{"url":"https://github.com/datamodel-code-generator/datamodel-code-generator/releases/tag/0.84.0","tags":["release-notes"]},{"url":"https://github.com/datamodel-code-generator/datamodel-code-generator/commit/ebfc11d0644d37a71374b28aac06d98748e584ec","tags":["patch","issue-tracking"]},{"url":"https://www.vulncheck.com/advisories/datamodel-code-generator-code-injection-via-x-python-type-annotation","tags":["third-party-advisory"]}],"priority":{"score":12.5,"factors":[{"name":"EPSS percentile","points":6.38},{"name":"CVSS severity","points":6.16}]},"vendorSlug":"datamodel-code-generator","affectedVersions":[{"vendor":"datamodel-code-generator","product":"datamodel-code-generator","versions":["< 0.84.0"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2026-11-13T15:34:54.409817Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2026-124714","exploited":false,"provenance":"source"}}