CVE-2026-54655 json
`datamodel-code-generator` vulnerable to code execution on import via `x-python-type` JSON-Schema extension in datamodel-code-generator
published 2026-07-28 3 mo ago modified 2026-10-23 16 d ago also EUVD-2026-50071 , GHSA-m34r-v34r-rf9q , PYSEC-2026-3562
- cvss
- 7.8
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.2%
- EPSS 0.2% chance of exploitation in 30 days, percentile 11%
- public exploits
- 0
- none known
Summary
datamodel-code-generator generates Python data models from schema definitions. From 0.51.0 until 0.60.2, x-python-type values parsed by src/datamodel_code_generator/parser/jsonschema.py in _get_python_type_override are inserted into generated field annotations without sufficient validation, allowing attacker-controlled JSON Schema content to execute Python code when the generated module is imported. This issue is fixed in version 0.60.2.
Patch / fix
- pypi datamodel-code-generator 0.60.2
- koxudaxi datamodel-code-generator 0.60.2
CISA SSVC
- Exploitation
- Proof of concept is public
- Automatable
- no
- Technical impact
- total
- Assessed
- 3 mo ago
Exploit prediction
0.21% chance of exploitation in the next 30 days, higher than 11% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- github.com https://github.com/koxudaxi/datamodel-code-generator/security/advisories/GHSA-m34r-v34r-rf9q referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 7.8 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| GitHub | 3.1 | 7.8 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| OSV | 3.1 | 7.8 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | datamodel-code-generator | >=0.51.0, <0.60.2 |
0.60.2 |
Affected products
- koxudaxi datamodel-code-generator
Classification
- Weakness
-
- CWE-94 Improper Control of Generation of Code
References
-
github.com
/koxudaxi/datamodel-code-generator/commit/2c93c9b712f43391dcfa975a1e4aa0b7c93ccbba
web
-
github.com
/koxudaxi/datamodel-code-generator/security/advisories/GHSA-m34r-v34r-rf9q
exploit, web
-
github.com
/koxudaxi/datamodel-code-generator/releases/tag/0.60.2
web
-
github.com
/koxudaxi/datamodel-code-generator
package
-
pypi.org
/project/datamodel-code-generator
package
-
github.com
/advisories/GHSA-m34r-v34r-rf9q
advisory
-
nvd.nist.gov
/vuln/detail/CVE-2026-54655
advisory
Sources
- CVE List CVE-2026-54655
- GitHub Advisory GHSA-m34r-v34r-rf9q
- NVD CVE-2026-54655
- OSV PYSEC-2026-3562
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.
CPEs and fixed versions use Anchore's correction of NVD's data: Added CPE configurations because not yet analyzed by NVD.