CVE-2026-55415
Description
datamodel-code-generator generates Pydantic v2 models, dataclasses, TypedDict, and msgspec.Struct from OpenAPI, JSON Schema, GraphQL, Avro, Protobuf, and raw JSON, YAML, or CSV. From 0.11.6 until 0.64.0, datamodel-code-generator allows attacker-controlled x-python-import or customTypePath schema extensions to reach src/datamodel_code_generator/parser/jsonschema.py and generated import handling through Import.from_full_path and Imports.create_line in src/datamodel_code_generator/imports.py, allowing a newline to break out of an import statement and execute Python code when the generated model is imported. This issue is fixed in version 0.64.0.
Weakness
- CWE-94: Improper Control of Generation of Code
- CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code
CISA SSVC decision points
| Exploitation | poc |
|---|---|
| Automatable | no |
| Technical impact | total |
| Scored | 2026-07-29 |
Timeline
- 2026-07-28Published by the CNA21:37 UTC
- 2026-07-28GitHub advisory published (GHSA-5578-w22f-pfx9)same day
- 2026-07-29CISA SSVC decision recorded1 day after publication
Exploit and advisory records
GitHub advisory GHSA-5578-w22f-pfx9, affected packages:
| Package | Vulnerable versions | Fixed in |
|---|---|---|
| PyPI datamodel-code-generator | from 0.11.6 before 0.64.0 | 0.64.0 |
Affected products
Products listed as vulnerable. Upgrade to the version under "Fixed in", or a later one.
| Product | Vulnerable versions | Fixed in |
|---|---|---|
| koxudaxi datamodel-code-generator | from 0.11.6 before 0.64.0fixed in 0.64.0 | 0.64.0 |
References
- https://github.com/koxudaxi/datamodel-code-generator/commit/577d49569c2254c371a97e495020ae2238a73b84
- https://github.com/koxudaxi/datamodel-code-generator/security/advisories/GHSA-5578-w22f-pfx9
- https://github.com/koxudaxi/datamodel-code-generator/releases/tag/0.64.0
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cve_lookup/CVE-2026-55415'curl 'https://api.contrastcyber.com/cve_risk_score/CVE-2026-55415'curl 'https://api.contrastcyber.com/cve_exploit/CVE-2026-55415'curl 'https://api.contrastcyber.com/cve_products/CVE-2026-55415'
Sources
- Vulnerability data from the National Vulnerability Database (NIST) and the CVE Program. CVE records: Copyright © 1999-2026, The MITRE Corporation, used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation.
- CWE definitions: Copyright © 2006-2026, The MITRE Corporation, used under the CWE Terms of Use. CWE is a trademark of The MITRE Corporation.
- OWASP Top 10 categories by the OWASP Foundation (CC BY 3.0).
- EPSS scores by FIRST.org EPSS, used with attribution.
- KEV catalog and SSVC decisions by CISA.
- Advisory data from the GitHub Advisory Database through OSV.dev (CC BY 4.0).
- Exploit metadata from the Exploit Database (GPL-2.0-only, metadata only).
- Nuclei template names from nuclei-templates (MIT).