CVE Catalog

CVE-2026-55415

HighCVSS 7.5
Published: Updated: Translated: NVD NIST

Exploitation Probability (EPSS)

Low risk
0.29%

21th percentile - higher than 21% of all known CVEs

Summary

In datamodel-code-generator from 0.11.6 to 0.64.0, attacker-controlled x-python-import or customTypePath schema extensions can reach the JSON Schema parser and generate imports that allow newline injection into import statements, executing Python code when the generated model is imported.

Risk Assessment

An attacker can provide a crafted OpenAPI or JSON Schema that, when the model is generated and imported, executes arbitrary Python code, leading to system compromise.

Recommendation

Update datamodel-code-generator to version 0.64.0 or later, which includes a fix preventing code injection via schema extensions.

Other vulnerabilities in datamodel-code-generator

See all
Original NVD description (English source)

datamodel-code-generator generates Pydantic v2 models, dataclasses, TypedDict, and msgspec.Struct from OpenAPI, JSON Schema, GraphQL, Avro, Protobuf, and raw JSON, YAML, or CSV. From 0.11.6 until 0.64.0, datamodel-code-generator allows attacker-controlled x-python-import or customTypePath schema extensions to reach src/datamodel_code_generator/parser/jsonschema.py and generated import handling through Import.from_full_path and Imports.create_line in src/datamodel_code_generator/imports.py, allowing a newline to break out of an import statement and execute Python code when the generated model is imported. This issue is fixed in version 0.64.0.

Vulnerability data from NVD (NIST) · CISA KEV · EPSS