CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-55389

CVE-2026-55389: Path Traversal and Security Control Bypass in datamodel-code-generator via Scheme Reference Resolution

Amit Schendel
Amit Schendel
Senior Security Researcher

Jul 29, 2026·4 min read·40 visits

Executive Summary (TL;DR)

Unauthenticated path traversal and local file read vulnerability in datamodel-code-generator prior to 0.62.0 allowed attackers to bypass --no-allow-remote-refs using the file:// scheme or relative pathing, revealing host system file structure and secrets.

An arbitrary local file read and path traversal bypass vulnerability in datamodel-code-generator before version 0.62.0 allows unauthenticated remote attackers to read arbitrary files via crafted JSON-Schema $ref references using the file:// scheme or directory traversal sequences.

Vulnerability Overview

The Python package datamodel-code-generator parses structured schemas like JSON Schema, OpenAPI, and GraphQL to automatically generate Pydantic models, dataclasses, or TypedDict implementations.

To facilitate modular schema design, the package supports the $ref keyword, allowing references to external definitions located either locally or remotely.

Security controls like the --no-allow-remote-refs command-line flag were designed to restrict the parser from retrieving external resources.

However, a directory traversal and security bypass flaw in the reference resolution subsystem allowed attackers to access local files readable by the process user.

Root Cause Analysis

The vulnerability originates from two design flaws within the reference parser found in src/datamodel_code_generator/parser/jsonschema.py.

First, the validator functions defined in reference.py improperly categorized the file:// scheme as a valid URL via the is_url helper function.

Due to this classification, absolute file paths using the file:// scheme bypassed remote reference verification mechanisms even when --no-allow-remote-refs was enabled.

Second, the local file resolver failed to enforce strict directory sandboxing. This omission allowed absolute paths and relative directory traversal paths containing ../ to resolve outside the intended root directory.

Code Analysis

Prior to the patch, the is_url validator evaluated references using a simple prefix match:

# Vulnerable implementation of is_url in reference.py
def is_url(ref: str) -> bool:
    return ref.startswith(("https://", "http://", "file://"))

In _get_ref_body, the parser evaluated the reference, granting an exception to the file:// prefix when applying remote-ref blocks:

# Vulnerable path in jsonschema.py
if is_url(resolved_ref):
    if not resolved_ref.startswith("file://") and self.http_local_ref_path is None:
        if self.allow_remote_refs is False:
            raise Error(...) # Bypassed for file:// schemes

Because of this logic, file:// schemas completely bypassed security boundaries and reached the underlying file retrieval handler. Additionally, relative references were concatenated directly without standard verification:

# Relative traversal without containment check
full_path = self.base_path / resolved_ref

The patch in commit 2ff4a72b4550a2b2069754c5b075b1655067e5fb remediates this by introducing _resolve_local_ref_path, which uses Python's pathlib.Path.resolve and is_relative_to to enforce a strict boundary check.

Exploitation Scenarios

An attacker can exploit this flaw by submitting a crafted JSON Schema containing standard $ref pointers. If the application exposes code-generation capabilities through an API endpoint, exploitation can be performed remotely and without credentials.

An attacker can use the parser as a file-system oracle to identify valid system paths. If a target file exists, the parser attempts to parse it and returns a TypeError: Expected dict, got str error, whereas a missing file triggers a FileNotFoundError.

If the targeted files contain structured YAML or JSON definitions, such as internal configurations or keys, the generator includes the extracted data directly in the output models.

Impact Assessment

The vulnerability has been assigned a CVSS v3.1 score of 7.5, indicating high severity due to high confidentiality exposure. Successful exploitation allows unauthorized access to sensitive application source code, container configurations, and local credentials.

Because the component is frequently executed within build pipelines or automated backends, this compromise can lead to broader access to deployment environments.

There is no integrity or availability impact, as the attacker cannot write to or alter local filesystem contents via this vector.

Remediation & Mitigation

Users should update datamodel-code-generator to version 0.62.0 or higher immediately to resolve this security control bypass.

In version 0.62.0, the generator implements a strict boundary validator _resolve_local_ref_path that denies requests targeting paths outside the initialized input base path.

If upgrading is not immediately possible, validate input schemas before processing to remove $ref statements pointing to external URLs or paths with directory traversal sequences.

Fix Analysis (1)

Technical Appendix

CVSS Score
7.5/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Affected Systems

datamodel-code-generator

Affected Versions Detail

Product
Affected Versions
Fixed Version
datamodel-code-generator
koxudaxi
< 0.62.00.62.0
AttributeDetail
CVE IDCVE-2026-55389
Vulnerability TypeDirectory Traversal (CWE-22) / Security Control Bypass
CVSS Base Score7.5 (High)
Attack VectorNetwork (AV:N)
Affected Componentjsonschema parser (jsonschema.py)
Exploit StatusProof-of-Concept (PoC) documented
CISA KEV StatusNot Listed

MITRE ATT&CK Mapping

T1083File and Directory Discovery
Discovery
T1005Data from Local System
Collection
T1552Unsecured Credentials
Credential Access
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

The product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize elements within the pathname that can cause the pathname to resolve to a location outside of the restricted directory.

Vulnerability Timeline

Vulnerability reported privately to the package maintainer by Hamza Haroon (thegr1ffyn)
2026-06-10
Coordinated patch developed and finalized in the private repository
2026-07-28
datamodel-code-generator version 0.62.0 released to PyPI containing the fix
2026-07-28
Security advisory GHSA-8359-h9fx-j6v9 published; CVE-2026-55389 assigned
2026-07-28

References & Sources

  • [1]GitHub Security Advisory GHSA-8359-h9fx-j6v9
  • [2]Official Fix Commit on GitHub
  • [3]PyPI Release Tag 0.62.0
  • [4]Project Repository

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•28 minutes ago•CVE-2026-62683
3.1

CVE-2026-62683: Incorrect Authorization via Stale Public Shares in File Browser

File Browser versions prior to 2.63.17 contain an authorization and state-management flaw in the BoltDB storage backend. When an authenticated user deletes a shared directory via an HTTP request with a trailing slash (e.g., DELETE /api/resources/a/), the share cleanup routine queries the database index using the unnormalized path before stripping the trailing slash. Because canonical share paths are stored without trailing slashes (e.g., /a), the database prefix query fails to match the parent directory share record. If a directory with the same name is later recreated, the dormant public share hash automatically reactivates and exposes the new directory contents to unauthenticated users.

Alon Barad
Alon Barad
1 views•10 min read
•about 1 hour ago•CVE-2026-62297
7.5

CVE-2026-62297: Uncontrolled Memory Allocation and Denial of Service in ag-psd

An uncontrolled memory allocation vulnerability exists in ag-psd versions prior to 31.0.0. When parsing Adobe Photoshop Document (PSD) files, the readPsd() function reads image dimensions and color depth directly from the file header and allocates off-heap typed arrays without validating whether the requested memory size is proportional to the input stream or bounded by operational thresholds. An unauthenticated attacker can supply a crafted 52-byte PSD payload that triggers an immediate 3.35 GB memory allocation, resulting in process termination via the operating system Out-Of-Memory (OOM) killer.

Amit Schendel
Amit Schendel
3 views•10 min read
•about 2 hours ago•CVE-2026-126297
7.5

CVE-2026-126297: Algorithmic Complexity Denial of Service in NLTK ConllCorpusReader

CVE-2026-126297 (GHSA-v8f3-6phw-6mh9) is an uncontrolled resource consumption and algorithmic complexity vulnerability in the Natural Language Toolkit (NLTK) prior to version 3.10.4. Located in the Semantic Role Labeling (SRL) parser within `nltk/corpus/reader/conll.py`, the flaw allows an attacker to trigger quadratic O(N^2) CPU processing overhead by providing crafted CoNLL-formatted corpus inputs containing decoy span columns or nested full-width verb spans. Applications parsing untrusted linguistic corpora can experience prolonged CPU exhaustion and application-level Denial of Service (DoS).

Amit Schendel
Amit Schendel
3 views•12 min read
•about 3 hours ago•CVE-2026-126298
7.5

CVE-2026-126298: Quadratic Algorithmic Complexity Denial of Service in NLTK Tree.chomsky_normal_form

CVE-2026-126298 (also tracked as GHSA-r53h-rw34-8h97) is an algorithmic complexity Denial of Service (DoS) vulnerability in the Natural Language Toolkit (NLTK) Python library affecting all versions prior to 3.10.4. The vulnerability resides in the nltk.tree.transforms.chomsky_normal_form function and its corresponding public method Tree.chomsky_normal_form(). When transforming a parse tree into Chomsky Normal Form using the default right-factoring strategy, the function repeatedly invokes list.pop(0) inside a loop iterating over all children of a node. In CPython, removing the initial element of a standard list requires an O(N) memory shift operation, causing the overall binarization algorithm to degrade to O(N^2) quadratic time complexity relative to the width of a node. Furthermore, converting horizontal node width into vertical tree depth bypasses initial parsing depth bounds, triggering subsequent stack exhaustion (RecursionError) when recursive methods traverse the mutated structure. Unauthenticated remote attackers who can submit bracketed tree strings to applications invoking this transformation can exhaust single-threaded CPU resources or induce unhandled application exceptions.

Alon Barad
Alon Barad
6 views•12 min read
•about 4 hours ago•CVE-2026-126299
7.5

CVE-2026-126299: Quadratic Algorithmic Complexity Denial of Service in NLTK CCG Lexicon Parser

An algorithmic complexity vulnerability (CWE-407) in the Natural Language Toolkit (NLTK) before version 3.10.4 allows remote unauthenticated attackers to cause a denial of service via crafted Combinatory Categorial Grammar (CCG) lexicon strings. The parser in nltk.ccg.lexicon.fromstring performs repeated immutable string slicing, concatenation, and regex tail capturing, resulting in O(n^2) CPU consumption when processing wide, flat category definitions.

Alon Barad
Alon Barad
5 views•10 min read
•about 5 hours ago•CVE-2026-126295
7.1

CVE-2026-126295: Path Traversal and Unconfined File Access in NLTK BllipParser

CVE-2026-126295 (also tracked as GHSA-fg9w-wfp5-j933) is a path confinement bypass vulnerability in the Natural Language Toolkit (NLTK) affecting versions 3.10.0 prior to 3.10.4. The flaw resides in nltk/parse/bllip.py within the BllipParser class and its factory method BllipParser.from_unified_model_dir(). Unlike sibling tool wrappers in NLTK that enforce data-root confinement via the nltk.pathsec module, BllipParser passes caller-supplied filesystem paths directly into the third-party bllipparser native C extension without validation. When an application passes untrusted input as model paths or directories to BllipParser, an attacker can force the native extension to open arbitrary files on the local filesystem. This leads to information disclosure through parser diagnostic oracles, local model tampering via shared directories, and denial of service by hanging worker threads on blocking special files (such as FIFOs or device nodes) or exhausting memory via oversized files.

Amit Schendel
Amit Schendel
2 views•11 min read