# CVE-2026-54655: `datamodel-code-generator` vulnerable to code execution on import via `x-python-type` JSON-Schema extension in datamodel-code-generator

- Severity: High 7.8 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.14%, higher than 3% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-07-28T21:33:45.438Z
- Modified: 2026-10-23T23:10:00.157Z
- Also known as: GHSA-m34r-v34r-rf9q, PYSEC-2026-3562
- Weaknesses: CWE-94
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- koxudaxi datamodel-code-generator: >= 0.51.0, < 0.60.2
- datamodel-code-generator (PyPI): from 0.51.0 before 0.60.2

## Every score

- GitHub_M: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- GitHub: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- PyPA Advisory Database: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`

## References

- <https://github.com/koxudaxi/datamodel-code-generator/security/advisories/GHSA-m34r-v34r-rf9q> (exploit, web)
- <https://github.com/koxudaxi/datamodel-code-generator/commit/2c93c9b712f43391dcfa975a1e4aa0b7c93ccbba> (web)
- <https://github.com/koxudaxi/datamodel-code-generator/releases/tag/0.60.2> (web)
- <https://github.com/koxudaxi/datamodel-code-generator> (package)
- <https://pypi.org/project/datamodel-code-generator> (package)
- <https://github.com/advisories/GHSA-m34r-v34r-rf9q> (advisory)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-54655> (advisory)

## Sources

- CVE List: [CVE-2026-54655](https://www.cve.org/CVERecord?id=CVE-2026-54655), CVE Terms of Use, modified 2026-07-29
- GitHub Advisory Database: [GHSA-m34r-v34r-rf9q](https://github.com/advisories/GHSA-m34r-v34r-rf9q), CC-BY-4.0, modified 2026-08-04
- NVD: [CVE-2026-54655](https://nvd.nist.gov/vuln/detail/CVE-2026-54655), Public domain, modified 2026-10-23
- PyPA Advisory Database: [PYSEC-2026-3562](https://osv.dev/vulnerability/PYSEC-2026-3562), CC-BY-4.0, modified 2026-08-04

---

Page: https://cve.day/CVE-2026-54655 · Whole record: https://cve.day/CVE-2026-54655.json · Rebuilt by cve.day 2026-11-25T22:59:30.386Z
