CVE-2026-54655
HIGH 7.8CVSS 3.1`datamodel-code-generator` vulnerable to code execution on import via `x-python-type` JSON-Schema extension in datamodel-code-generator
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.
- Published
- 28 Jul 2026
- Last modified
- 23 Oct 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Deferred
- Weakness
- CWE-94
- Also known as
- GHSA-m34r-v34r-rf9qPYSEC-2026-3562
- Sources
- NVDJSONOSV GHSA-m34r-v34r-rf9qJSONOSV PYSEC-2026-3562JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | HIGH 7.8 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| OSV | GitHub | CVSS 3.1 | HIGH 7.8 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| OSV | PyPA | CVSS 3.1 | HIGH 7.8 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| OSV | PyPI | datamodel-code-generator | >= 0.51.0, < 0.60.2 | 0.60.2 |
References
- 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/security/advisories/GHSA-m34r-v34r-rf9q · 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
History
- 25 Nov 2026 21:04 UTC · NVD: first stored (published 28 Jul 2026)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 4 Aug 2026)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 28 Jul 2026)