{"id":"CVE-2026-127208","aliases":[],"url":"https://o3.security/vulnerability/CVE-2026-127208","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…","details":"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.","published":"2026-11-12T21:17:22.933","modified":"2026-11-12T21:17:23.090","cvss":{"score":8.8,"severity":"HIGH","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"},"epss":null,"cisaKev":null,"exploitsKnown":null,"affectedPackages":[],"fix":{"url":"https://github.com/datamodel-code-generator/datamodel-code-generator/commit/ebfc11d0644d37a71374b28aac06d98748e584ec","label":"datamodel-code-generator/datamodel-code-generator@ebfc11d"},"references":[{"type":"WEB","url":"https://github.com/datamodel-code-generator/datamodel-code-generator/commit/ebfc11d0644d37a71374b28aac06d98748e584ec"},{"type":"WEB","url":"https://github.com/datamodel-code-generator/datamodel-code-generator/releases/tag/0.84.0"},{"type":"WEB","url":"https://www.vulncheck.com/advisories/datamodel-code-generator-code-injection-via-x-python-type-annotation"}],"provenance":{"sources":["OSV.dev","NVD","FIRST.org (EPSS)"],"lastVerified":"2026-11-12T21:17:23.090"}}