top of page
perceptive_background_267k.jpg

datamodel-code-generator generates Python data models from schema definitions. Prior to 0.60.1, GraphQL Union description values in src/datamodel_code_generator…

Published:

27 July 2026 at 22:00:00

Alert date:

28 July 2026 at 23:04:30

Source:

nvd.nist.gov

Click to open the original link from this advisory

Supply Chain & Dependencies, Web Technologies

A code injection vulnerability exists in datamodel-code-generator prior to version 0.60.1. The flaw resides in Jinja2 templates used to generate Python models from GraphQL Union type definitions. GraphQL Union description values are rendered into Python comments without neutralizing carriage return characters, allowing attacker-controlled GraphQL schema content to inject arbitrary Python code into generated model files. This injected code executes automatically when the generated Python modules are imported. The vulnerability affects two template files: UnionTypeStatement.jinja2 and UnionTypeStatement.py312.jinja2. Exploitation requires an attacker to control or influence the GraphQL schema input provided to the code generator. The issue has been remediated in version 0.60.1 of datamodel-code-generator.

Technical details

Mitigation steps:

Affected products:

datamodel-code-generator

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

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

bottom of page