CVE-2026-55389: Path Traversal and Security Control Bypass in datamodel-code-generator via Scheme Reference Resolution
Vulnerability ID: CVE-2026-55389
CVSS Score: 7.5
Published: 2026-07-28
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.
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.
⚠️ Exploit Status: POC
Technical Details
- CVE ID: CVE-2026-55389
- Vulnerability Type: Directory Traversal (CWE-22) / Security Control Bypass
- CVSS Base Score: 7.5 (High)
- Attack Vector: Network (AV:N)
- Affected Component: jsonschema parser (jsonschema.py)
- Exploit Status: Proof-of-Concept (PoC) documented
- CISA KEV Status: Not Listed
Affected Systems
- datamodel-code-generator
-
datamodel-code-generator: < 0.62.0 (Fixed in:
0.62.0)
Code Analysis
Commit: 2ff4a72
Fix arbitrary local file read / path traversal vulnerability inside jsonschema parser
Mitigation Strategies
- Upgrade to datamodel-code-generator version 0.62.0 or newer.
- Enforce strict input validation on JSON schemas containing external $ref structures.
- Disable parsing of untrusted user-supplied schemas in automated backend environments.
Remediation Steps:
- Identify internal usages of datamodel-code-generator in dependency manifests (e.g., requirements.txt, pyproject.toml).
- Update the package pin to >=0.62.0.
- Test build pipelines to ensure schema configurations continue resolving trusted internal paths correctly.
References
- GitHub Security Advisory GHSA-8359-h9fx-j6v9
- Official Fix Commit on GitHub
- PyPI Release Tag 0.62.0
- Project Repository
Read the full report for CVE-2026-55389 on our website for more details including interactive diagrams and full exploit analysis.
Top comments (0)