# CVE-2026-55389: koxudaxi datamodel-code-generator local file read via JSON Schema ref

Source: https://junglewise.ai/threats/cve-2026-55389-koxudaxi-datamodel-code-generator-local-file-read-via-json-schema  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-28. Updated: 2026-07-28  
License: CC BY 4.0 with a link back

CVE-2026-55389 · Severity: high · CVSS 7.5 · Published 2026-07-28

datamodel-code-generator is a tool used by developers to automatically create Python code from data schemas like OpenAPI or JSON Schema. A security flaw in this tool allows a specially crafted schema file to read sensitive files from the computer or server running the generator. This is particularly dangerous for web-based services or automated build systems that process user-provided schema files, as it could lead to the theft of configuration files, credentials, or other private data.

Technologies: [Koxudaxi Datamodel-Code-Generator](https://junglewise.ai/threats/technologies/datamodel-code-generator), [datamodel-code-generator (PyPI)](https://junglewise.ai/threats/technologies/pypi-datamodel-code-generator). Vendors: [Koxudaxi](https://junglewise.ai/threats/vendors/koxudaxi), [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2026-55389 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-55389 being exploited in the wild.

**How severe is CVE-2026-55389?** High severity, with a CVSS score of 7.5, published 28 July 2026.

**Which products and versions are affected?** Koxudaxi Datamodel-Code-Generator < 0.62.0, <= 0.61.0; datamodel-code-generator (PyPI) ECOSYSTEM:introduced=0,fixed=0.62.0.

**Is there a fix for CVE-2026-55389?** Yes. datamodel-code-generator (PyPI): upgrade to 0.62.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-55389 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-55389?** Check whether you run Koxudaxi Datamodel-Code-Generator or datamodel-code-generator (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- datamodel-code-generator (PyPI): upgrade to 0.62.0 or later

  ```sh
  pip install "datamodel-code-generator>=0.62.0"
  ```


## Technical details

A path traversal and information disclosure vulnerability exists in datamodel-code-generator's JSON Schema parser. The root cause is located in `src/datamodel_code_generator/parser/jsonschema.py` within the `_get_ref_body` method, which fails to restrict `$ref` targets to the input directory. Specifically, the `is_url` check classifies `file://` URIs as URLs but then explicitly exempts them from the `allow_remote_refs` security gate. This allows an attacker to use absolute `file://` URIs or relative `../` traversal sequences to read any file accessible to the process user. The vulnerability is exploitable in any environment where the generator processes untrusted schemas, such as multi-tenant codegen platforms or CI/CD pipelines. The issue is fixed in version 0.62.0 by enforcing base-path containment and honoring the remote-reference block for local file URIs.

## Affected products

- koxudaxi datamodel-code-generator < 0.62.0

## Identifiers

- CVE-2026-55389
- GHSA-8359-h9fx-j6v9
- PYSEC-2026-3558

## Timeline

- 2026-06-10: patched: Version 0.62.0 released
- 2026-06-11: other: Fix commit merged to main branch
- 2026-06-12: advisory: GitHub Security Advisory GHSA-8359-h9fx-j6v9 published
- 2026-07-28: disclosed: CVE-2026-55389 published to NVD

## References

- [https://github.com/koxudaxi/datamodel-code-generator/commit/2ff4a72b4550a2b2069754c5b075b1655067e5fb](https://github.com/koxudaxi/datamodel-code-generator/commit/2ff4a72b4550a2b2069754c5b075b1655067e5fb)
- [https://github.com/koxudaxi/datamodel-code-generator/releases/tag/0.62.0](https://github.com/koxudaxi/datamodel-code-generator/releases/tag/0.62.0)
- [https://github.com/koxudaxi/datamodel-code-generator/security/advisories/GHSA-8359-h9fx-j6v9](https://github.com/koxudaxi/datamodel-code-generator/security/advisories/GHSA-8359-h9fx-j6v9)

## Related threats

- [datamodel-code-generator Protobuf path traversal allows files to be written outside directory](https://junglewise.ai/threats/cve-2026-107377-datamodel-code-generator-protobuf-weak-import-path-traversal)
- [koxudaxi datamodel-code-generator code injection in generated imports](https://junglewise.ai/threats/cve-2026-55415-koxudaxi-datamodel-code-generator-code-injection-in-generated)
- [koxudaxi datamodel-code-generator credential leak in cross-origin redirects](https://junglewise.ai/threats/cve-2026-55403-koxudaxi-datamodel-code-generator-credential-leak-in-cross-origin)
- [koxudaxi datamodel-code-generator SSRF via DNS rebinding](https://junglewise.ai/threats/cve-2026-55391-koxudaxi-datamodel-code-generator-ssrf-via-dns-rebinding)
- [koxudaxi datamodel-code-generator path traversal in XML Schema parsing](https://junglewise.ai/threats/cve-2026-55390-koxudaxi-datamodel-code-generator-path-traversal-in-xml-schema)
