CVE-2026-55390

Arbitrary local file read via XSD `schemaLocation` (`xs:include`/`xs:import`) path traversal, with no remote-ref gate

Published Jul 28, 2026 CVSS 3.1 · 7.5 High EPSS < 1% KEV · Not listed
Description
datamodel-code-generator generates Python data models from schema definitions. From 0.59.0 until 0.62.0, XML Schema parsing in src/datamodel_code_generator/parser/xmlschema.py for --input-file-type xmlschema resolves xs:include, xs:import, xs:redefine, and xs:override schemaLocation values outside the input base path, allowing arbitrary local files to be read and reflected into generated models. This issue is fixed in version 0.62.0.

Analysis

AI-generated

Technical impact

datamodel-code-generator is a tool that produces Python data models from schema files. In versions 0.59.0 through 0.61.x the XML schema parser resolves xs:include, xs:import, xs:redefine, and xs:override schemaLocation references outside the input base directory, allowing an adversary to read any local file and embed its contents into the generated model, resulting in information disclosure and corresponding to CWE‑200, CWE‑22, and CWE‑610.

Affected Systems

The affected product is datamodel-code-generator from koxudaxi. Versions 0.59.0 to 0.61.x inclusive are vulnerable; the issue was fixed in 0.62.0 and later.

Risk and Exploitability

The vulnerability receives a CVSS score of 7.5, indicating a high severity for confidentiality impact. The EPSS score is less than 1%, suggesting a low probability of exploitation. Because the flaw requires the ability to supply a crafted XML schema to the generator, the attack vector is local; any user who can invoke datamodel-code-generator can use a malicious schemaLocation to read arbitrary files. The issue is not listed in the CISA KEV catalog, and there are no known public exploits, but the potential for sensitive data leakage warrants immediate action.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to datamodel-code-generator 0.62.0 or later, where the path traversal bug is fixed.
  • If an upgrade is not immediately possible, run the generator inside a sandboxed environment with read‑only access to the file system to constrain potential local file reads.
  • Validate all XML schemas before processing, restricting schemaLocation references to trusted directories and ensuring that any supplied schema originates from a verified source.

Generated by OpenCVE AI on August 4, 2026 at 12:47 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-442q-2j6p-642g datamodel-code-generator vulnerable to arbitrary local file read via XSD `schemaLocation` (`xs:include`/`xs:import`) path traversal, with no remote-ref gate
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Koxudaxi
Koxudaxi datamodel-code-generator
Vendors & Products Koxudaxi
Koxudaxi datamodel-code-generator
Type Values Removed Values Added
Description datamodel-code-generator generates Python data models from schema definitions. From 0.59.0 until 0.62.0, XML Schema parsing in src/datamodel_code_generator/parser/xmlschema.py for --input-file-type xmlschema resolves xs:include, xs:import, xs:redefine, and xs:override schemaLocation values outside the input base path, allowing arbitrary local files to be read and reflected into generated models. This issue is fixed in version 0.62.0.
Title Arbitrary local file read via XSD `schemaLocation` (`xs:include`/`xs:import`) path traversal, with no remote-ref gate
Weaknesses CWE-200
CWE-22
CWE-610
References
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N'}

Weaknesses
  • CWE-200

    Exposure of Sensitive Information to an Unauthorized Actor

  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

  • CWE-610

    Externally Controlled Reference to a Resource in Another Sphere

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jul 29, 2026, 2:16 PM
Reserved
Jun 16, 2026, 6:57 PM
Status
Deferred
Published
Jul 28, 2026, 10:17 PM
Modified
Oct 23, 2026, 11:10 PM