Skip to main content
← All vulnerabilities
CVE-2026-54655GHSA-M34R-V34R-RF9QPYSEC-2026-3562

`datamodel-code-generator` vulnerable to code execution on import via `x-python-type` JSON-Schema extension in datamodel-code-generator

Published
Last modified
published
Not listed in CISA KEV
Fix
Fixed in 0.60.2
None on Exploit-DB, Metasploit or GitHub
  • Exploitation: poc
  • Automatable: no
  • Technical impact: total

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.

Timeline

  1. CVE published
  2. CISA SSVC assessment

    Exploitation: poc · Automatable: no · Technical impact: total

  3. Record last updated

Affected versions

  • koxudaxi datamodel-code-generator

    From 0.51.0 · fixed in 0.60.2

  • datamodel-code-generatorPyPI

    From 0.51.0 · fixed in 0.60.2

References 3

GitHub · koxudaxi/datamodel-code-generator