datamodel-code-generator before 0.84.0 contains a code injection vulnerability that allows attackers to achieve
Source GCVE Database
Not known to be exploited · CVSS 8.6 High : upgrade to 0.84.0 soon.
Data as of 12 Nov 2026, 22:23 UTC
Thin evidence
One scorer or none| CNA (VulnCheck) | CVSS 4.0 | 8.6 |
|---|---|---|
| CNA (VulnCheck) | CVSS 3.1 | 8.8 |
- Patch
- Available – fixed in 0.84.0
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:NExploitation evidence
Disclosed: evidence found.
CVE published 12 Nov 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 12 Nov 2026.
What to do
Upgrade datamodel-code-generator to 0.84.0.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| datamodel-code-generatordatamodel-code-generator | Affected
| Fixed in
|
PyPIdatamodel-code-generatorpkg:pypi/datamodel-code-generatorOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
A fix is available in datamodel-code-generator version 0.84.0 and later. Users should upgrade to version 0.84.0 or newer to remediate this vulnerability. Until patched, avoid processing untrusted JSON Schemas with x-python-type annotations or running generated models in sensitive environments.
Description
datamodel-code-generator versions before 0.84.0 contain a code injection vulnerability. This flaw allows attackers to execute arbitrary code by providing a malicious JSON Schema with a specially crafted x-python-type annotation. The vulnerability arises because the validation functions parse_python_type_annotation and _python_type_expr_from_ast can be bypassed, enabling malicious Python expressions to be embedded and later evaluated by Pydantic v2 during model rebuilding. This can lead to arbitrary code execution on developer machines, CI/CD pipelines, or runtime environments that generate and import these models.
References
- nvd.nist.gov/vuln/detail/CVE-2026-127208 (opens in a new tab)
- github.com/datamodel-code-generator/datamodel-code-generator/commit/ebfc11d0644d37a71374b28aac06d98748e584ec (opens in a new tab)
- github.com/datamodel-code-generator/datamodel-code-generator/releases/tag/0.84.0 (opens in a new tab)
- vulncheck.com/advisories/datamodel-code-generator-code-injection-via-x-python-type-annotation (opens in a new tab)