CVE-2026-55389
Received Received - Intake

Arbitrary Local File Read in datamodel-code-generator

Vulnerability report for CVE-2026-55389, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-07-28

Last updated on: 2026-07-28

Assigner: GitHub, Inc.

Description

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. Prior to 0.62.0, datamodel-code-generator resolves JSON Schema $ref targets in src/datamodel_code_generator/parser/jsonschema.py through is_url and _get_ref_body without containing file:// or ../ traversal references to the input directory and without honoring --no-allow-remote-refs, allowing arbitrary local file reads. This issue is fixed in version 0.62.0.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-07-28
Last Modified
2026-07-28
Generated
2026-07-29
AI Q&A
2026-07-29
EPSS Evaluated
N/A
NVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
datamodel-code-generator datamodel-code-generator 0.62.0

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-200 The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.
CWE-22 The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
CWE-610 The product uses an externally controlled name or reference that resolves to a resource that is outside of the intended control sphere.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

The vulnerability in datamodel-code-generator before version 0.62.0 allows arbitrary local file reads due to improper handling of JSON Schema $ref targets. The tool resolves references without validating file:// or ../ paths or respecting the --no-allow-remote-refs option, enabling attackers to read sensitive files on the system.

Detection Guidance

Check the version of datamodel-code-generator installed on your system. If it is below 0.62.0, the vulnerability is present. Run: pip show datamodel-code-generator or pip list | grep datamodel-code-generator.

Impact Analysis

This vulnerability could allow an attacker to read sensitive files on your system if you use a vulnerable version of datamodel-code-generator. The impact includes potential exposure of confidential data, configuration files, or other sensitive information stored locally.

Compliance Impact

The vulnerability allows arbitrary local file reads due to improper handling of JSON Schema $ref targets. This could lead to unauthorized access to sensitive data, potentially violating GDPR (data protection) and HIPAA (health information privacy) compliance by exposing personal or protected health information.

Mitigation Strategies

Upgrade datamodel-code-generator to version 0.62.0 or later immediately. Run: pip install --upgrade datamodel-code-generator. Avoid using versions prior to 0.62.0 for processing untrusted input.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-55389. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart