LiveActive security incident?Get immediate response
CVE Record

CVE-2026-54655: `datamodel-code-generator` vulnerable to code execution on import via `x-python-type` JSON-Schema extension in datamodel-code-generator

datamodel-code-generator generates Python data models from schema definitions. From 0.51.0 until 0.60.2, x-python-type values parsed by src/datamodel_code_generator/parser/jsonschema.py in _get_python_type_override are inserted into generated field annotations without sufficient validation, allowing attacker-controlled JSON Schema content to execute Python code when the generated module is imported. This issue is fixed in version 0.60.2.

HighCVSS 7.8Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

A malicious JSON Schema can abuse the x-python-type extension so generated Python code runs attacker-controlled instructions when imported. This could compromise the importing user or system, exposing data, altering files, or disrupting services. The risk is concentrated in workflows that accept schemas from untrusted or insufficiently controlled sources.

Executive priority

Prioritize remediation for CI, build, developer, or service workflows that process third-party schemas and import generated modules. Upgrade promptly and review previously generated artifacts. Lower priority may be reasonable only after confirming schemas are trusted, affected versions are absent, or generated output is never imported.

Technical view

Versions 0.51.0 through 0.60.1 insufficiently validate x-python-type values in the JSON Schema parser. Attacker-controlled values can enter generated field annotations and execute as Python when the generated module is imported. This is CWE-94 code injection with CVSS 3.1 score 7.8. Version 0.60.2 contains the fix.

Likely exposure

Exposure requires an affected generator version, attacker-influenced JSON Schema content using x-python-type, and subsequent import of the generated Python module. CI pipelines, developer tooling, and automated schema-processing services are higher concern when schema provenance is not strictly controlled. Systems that never process untrusted schemas or import generated output have reduced exposure.

Exploitation context

The supplied sources do not establish active exploitation, and the CVE is not listed as KEV in the bundle. Exploitation requires user or automated workflow interaction because malicious schema content must be processed and the resulting module imported. Successful exploitation could affect confidentiality, integrity, and availability within the importing process's privileges.

Researcher notes

The vulnerable path is _get_python_type_override in the JSON Schema parser. The security boundary failure is insufficient validation before x-python-type content reaches Python annotations. Import is the execution trigger described by the advisory. The source bundle provides no evidence of exploitation in the wild, public weaponization, or affected products beyond datamodel-code-generator.

Mitigation direction

  • Upgrade datamodel-code-generator to version 0.60.2 or later.
  • Regenerate affected models from trusted schemas after upgrading.
  • Reject or quarantine schemas from untrusted or unverifiable sources.
  • Avoid importing output generated by vulnerable versions until reviewed.
  • Check the vendor advisory for any subsequent remediation guidance.

Validation and detection

  • Inventory installed, locked, and build-time datamodel-code-generator versions.
  • Identify workflows accepting externally supplied or repository-contributed JSON Schemas.
  • Determine whether generated modules are automatically imported or executed.
  • Verify production and CI environments use version 0.60.2 or later.
  • Review previously generated modules and their source-schema provenance.
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
description · low confidence lookup

Execution behavior lookup

The CVE wording references code or command execution, so execution technique review may help defensive triage. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2026-54655 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.8 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:L/AC:L/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.8CVSS 3.1HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H1.85.9GitHub_M

Vulnerability scoring details

Base CVSS 3.1 score

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

Vector: CVSS:3.1/AV:L/AC:L/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.51.0, < 0.60.2Listed
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.