CVE-2026-54655
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.
How to fix
- datamodel-code-generator0.60.2 or later
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| datamodel-code-generatorPyPI | 0.51.0 ≤ v < 0.60.2 | 0.60.2 |
Check your version
Choose the product and enter the version you run to see whether it falls in the affected range.
Attack Surface Management
See the assets tied to your domains, the technologies they run and known vulnerabilities in one list.