top of page
perceptive_background_267k.jpg

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_gener…

Published:

27 juli 2026 om 22:00:00

Alert date:

28 juli 2026 om 23:04:30

Source:

nvd.nist.gov

Click to open the original link from this advisory

Supply Chain & Dependencies, Web Technologies, Security Tools

A code injection vulnerability exists in datamodel-code-generator versions 0.51.0 through 0.60.1. The library, which generates Python data models from schema definitions, fails to sufficiently validate x-python-type values parsed from JSON Schema files. Attacker-controlled JSON Schema content can insert malicious Python code into generated field annotations. This code executes when the generated module is imported, enabling arbitrary code execution. The vulnerable function is _get_python_type_override in src/datamodel_code_generator/parser/jsonschema.py. The vulnerability is classified as a supply chain risk since it affects code generation tooling. The issue was fixed in version 0.60.2. Developers using this tool to process untrusted schema files are at risk.

Technical details

Mitigation steps:

Affected products:

datamodel-code-generator 0.51.0 - 0.60.1

Related links:

Related CVE's:

Related threat actors:

IOC's:

This article was created with the assistance of AI technology by Perceptive.

© 2025 by Perceptive Security. All rights reserved.

email: info@perceptivesecurity.com

Deze website toont informatie afkomstig van externe bronnen; Perceptive aanvaardt geen verantwoordelijkheid voor de juistheid, volledigheid of actualiteit van deze informatie.

bottom of page