LiveActive security incident?Get immediate response
CVE Record

CVE-2026-55415: datamodel-code-generator vulnerable to code injection via `x-python-import` / `customTypePath` in generated import statements

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.

HighCVSS 7.5Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

A malicious schema can insert Python code into generated models. That code executes when the model is imported, potentially compromising developer workstations, build systems, or applications. Exploitation requires a vulnerable generator, attacker-controlled schema content, and a user or process importing the generated output.

Executive priority

Prioritize remediation where external schemas enter automated build or code-generation workflows. Compromise could affect confidentiality, integrity, and availability with the permissions of the importing process. Environments using only trusted schemas remain affected by version, but have lower practical exposure.

Technical view

Versions 0.11.6 through 0.63.x insufficiently constrain x-python-import or customTypePath values. A newline can escape generated import syntax through Import.from_full_path and Imports.create_line, producing attacker-controlled Python statements. The vulnerability is classified as CWE-94/CWE-95 and fixed in version 0.64.0.

Likely exposure

Highest exposure exists where CI/CD pipelines, developer tooling, or services generate models from externally supplied or insufficiently trusted schemas, then import those models. Installations below 0.64.0 are affected, but package presence alone does not prove an exploitable data flow.

Exploitation context

The supplied sources do not report active exploitation, and this CVE is not identified as KEV. Exploitation has high complexity and requires user interaction because malicious schema input must reach generation and the resulting Python model must subsequently be imported.

Researcher notes

The relevant trust boundary is schema content reaching generated Python imports. Assessment should trace schema provenance, extension handling, artifact review, and subsequent imports. The supplied bundle identifies the vulnerable functions and fixing commit, but provides no evidence of exploitation in the wild.

Mitigation direction

  • Upgrade datamodel-code-generator to version 0.64.0 or later.
  • Regenerate models previously created from untrusted or externally supplied schemas.
  • Review generated Python files before importing or deploying them.
  • Restrict schema ingestion to trusted sources until upgrades and artifact reviews are complete.

Validation and detection

  • Inventory datamodel-code-generator versions across developer, CI/CD, and production environments.
  • Identify workflows processing OpenAPI, JSON Schema, GraphQL, Avro, Protobuf, JSON, YAML, or CSV inputs.
  • Determine whether untrusted inputs can control x-python-import or customTypePath extensions.
  • Inspect generated models for unexpected statements or malformed import sections.
  • Confirm upgraded environments report version 0.64.0 or later.
Prepared
Confidence
high
Sources
5

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · medium confidence lookup

CWE-94: Code execution behavior lookup

Code execution and unsafe deserialization weaknesses often justify reviewing execution behavior and process telemetry. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
cwe · medium confidence lookup

CWE-95: Code execution behavior lookup

Code execution and unsafe deserialization weaknesses often justify reviewing execution behavior and process telemetry. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2026-55415 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
High
CVSS
7.5 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
3Timeline events
1ADP providers
4Source links

SSVC decision data

CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: pocAutomatable: noTechnical Impact: total

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
7.5CVSS 3.1HighCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H1.65.9GitHub_M

Vulnerability scoring details

Base CVSS 3.1 score

7.5High
CVSS 3.1 vector shape for CVE-2026-55415Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone

Vulnerability timeline

Timeline events are normalized from CVE metadata, CNA source timelines, ADP timelines, and KEV metadata when present.

  1. CVE reservedCVE Program

    The CVE ID was reserved by the assigning CNA.

  2. CVE publishedCVE Program

    The CVE record was published.

  3. CVE updatedCVE Program

    The CVE record metadata indicates this as the latest update time.

ADP provider summaries

CISA-ADPCISA ADP Vulnrichment
other:ssvc
Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
koxudaxidatamodel-code-generator>= 0.11.6, < 0.64.0Listed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-94 · source CWE mapping

Improper Control of Generation of Code ('Code Injection')

Improper Control of Generation of Code ('Code Injection') represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.

CWE-95 · source CWE mapping

Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection')

Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection') represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.