CVE-2026-54655

High

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.

SeverityHigh
CVSS7.8
Exploit probability—
ProductDatamodel-code-generator
PublishedJul 28, 2026
First seenJul 28, 2026

How to fix

Update
  • datamodel-code-generator0.60.2 or later

Affected products

ProductAffected versionsFixed in
datamodel-code-generatorPyPI0.51.0 ≤ v < 0.60.20.60.2

Check your version

Choose the product and enter the version you run to see whether it falls in the affected range.

In the Intelligence 360 plan

Attack Surface Management

See the assets tied to your domains, the technologies they run and known vulnerabilities in one list.