Python Code Execution Vulnerability in Datamodel Code Generator by Koxudaxi
CVE-2026-55415
7.5HIGH
What is CVE-2026-55415?
The datamodel-code-generator, used for generating Pydantic v2 models among other outputs, is susceptible to a code execution vulnerability that allows attackers to manipulate schema extensions. By exploiting this flaw, an attacker can inject a newline into an import statement through attacker-controlled x-python-import, leading to unintended code execution when the generated model is imported. This vulnerability impacts versions from 0.11.6 to 0.64.0 and has been addressed in version 0.64.0 to enhance the security of user applications.
Affected Version(s)
datamodel-code-generator >= 0.11.6, < 0.64.0
