PoC Monitor
← All CVEs
CVE-2026-127208published 12 Nov 2026 20:58 UTCData: JSON · API

Datamodel-code-generator

datamodel-code-generator < 0.84.0 Code Injection via x-python-type Annotation

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.

First public PoC None yetno public PoC found
Public PoCs00 on GitHub
CVSS8.8high · scored by CNA · CWE-94
CISA KEV Not listednot known exploited

Affected versions and mitigation

From the CVE record and the vendor's references.

Affected

datamodel-code-generator datamodel-code-generator
  • < 0.84.0

Fixed in 0.84.0

Mitigation

Upgrade datamodel-code-generator to 0.84.0 or later.

References

Timeline

Days relative to CVE publication
-2t=0+2+4+6+8CVE published12 Nov 2026 · t = 0

No public PoC found yet; not in CISA KEV.

PoC repositories

Found on GitHub.

No PoC repositories found yet.