Vulnerability record

CVE-2026-127208

highCVSS 4.0 8.6Published · datamodel-code-generator

The short answer

CVE-2026-127208 affects datamodel-code-generator datamodel-code-generator and is rated high (CVSS 8.6). It is not in CISA's Known Exploited Vulnerabilities catalog.

What it is

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.

Weakness: CWE-94.

Severity

8.6 high

CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

Exploited (CISA KEV)

Not listed

CISA lists confirmed exploitation only

EPSS, next 30 days

No score

FIRST scores CVEs within a day of publication

How it can be exploited

Attack vector
Network
Attack complexity
Low
Attack requirements
None
Privileges required
None
User interaction
Active
Confidentiality impact
High
Integrity impact
High
Availability impact
High

Affected products

datamodel-code-generator. NVD's record lists the exact affected versions.

References

Questions

Is CVE-2026-127208 being exploited?

It is not in CISA's Known Exploited Vulnerabilities catalog as of 2026-11-13.

How do I fix CVE-2026-127208?

Follow the vendor advisory in the references below. NVD lists the affected versions under its configurations.

From NVD, CISA KEV, FIRST EPSS and OSV.dev, checked . Status on NVD: Deferred. The description is NVD's text, quoted as published.

Related

Know the day a CVE lands in your code

Connect a GitHub repository and ZeusQA checks its dependencies daily, briefs each advisory and opens the fix. Three test runs free, no card.