PT-2026-65611

CVE-2026-54656

·

Published

2026-07-28

·

Updated

2026-08-06

Description by

CVSS 3.1
7.8
High
MetricsAV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Name of the Vulnerable Software and Affected Versions datamodel-code-generator versions 0.52.1 through 0.60.1
Description When using Pydantic v2 output mode, the software improperly handles data from the --extra-template-data file. Specifically, the process validators() function in src/datamodel code generator/model/pydantic v2/base model.py interpolates validator field names and modes into @field validator decorators without safe validation or escaping. An attacker can provide a value containing a single quote to break out of the string literal and inject arbitrary Python expressions. Additionally, the Import.from full path() function can be exploited by inserting a semicolon into the function path to execute statements during module load. This allows for remote code execution (RCE) in the developer's interpreter or CI runner the moment the generated module is imported.
Recommendations Upgrade datamodel-code-generator to version 0.60.2 or later.
Exploitability
Exploit
Fix
Impacts
Vendors
Affected products
Related identifiers
GHSA-8M8R-38JM-F355
PYSEC-2026-3559
Found an issue in the description? Have something to add? Feel free to write us 👾