๐Ÿ” CVE Alert

CVE-2026-127208

HIGH 8.8

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

CVSS Score
8.8
EPSS Score
0.0%
EPSS Percentile
0th

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.

CWE CWE-94
Vendor datamodel-code-generator
Product datamodel-code-generator
Published Nov 12, 2026
Stay Ahead of the Next One

Get instant alerts for datamodel-code-generator datamodel-code-generator

Be the first to know when new high vulnerabilities affecting datamodel-code-generator datamodel-code-generator are published โ€” delivered to Slack, Telegram or Discord.

Get Free Alerts โ†’ Free ยท No credit card ยท 60 sec setup

CVSS v3 Breakdown

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Affected Versions

datamodel-code-generator / datamodel-code-generator
0 < 0.84.0

References

NVD โ†— CVE.org โ†— EPSS Data โ†—
github.com: https://github.com/datamodel-code-generator/datamodel-code-generator/releases/tag/0.84.0 github.com: https://github.com/datamodel-code-generator/datamodel-code-generator/commit/ebfc11d0644d37a71374b28aac06d98748e584ec vulncheck.com: https://www.vulncheck.com/advisories/datamodel-code-generator-code-injection-via-x-python-type-annotation

Credits

Enrik Mustafa