# CVE-2026-55389: datamodel-code-generator vulnerable to arbitrary local file read via JSON-Schema `$ref` (`file://` and `../` traversal), bypassing `--no-allow-remote-refs`

- Severity: High 7.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.53%, higher than 46% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-07-28T21:49:21.260Z
- Modified: 2026-10-23T23:10:00.157Z
- Also known as: GHSA-8359-h9fx-j6v9, PYSEC-2026-3558
- Weaknesses: CWE-22, CWE-200, CWE-610
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- koxudaxi datamodel-code-generator: < 0.62.0; before 0.62.0
- datamodel-code-generator (PyPI): before 0.62.0

## Every score

- GitHub_M: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`
- GitHub: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`
- PyPA Advisory Database: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`

## References

- <https://github.com/koxudaxi/datamodel-code-generator/security/advisories/GHSA-8359-h9fx-j6v9> (exploit, vendor-advisory, web)
- <https://github.com/koxudaxi/datamodel-code-generator/commit/2ff4a72b4550a2b2069754c5b075b1655067e5fb> (patch, web)
- <https://github.com/koxudaxi/datamodel-code-generator/releases/tag/0.62.0> (release-notes, web)
- <https://github.com/koxudaxi/datamodel-code-generator> (package)
- <https://pypi.org/project/datamodel-code-generator> (package)
- <https://github.com/advisories/GHSA-8359-h9fx-j6v9> (advisory)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-55389> (advisory)

## Sources

- CVE List: [CVE-2026-55389](https://www.cve.org/CVERecord?id=CVE-2026-55389), CVE Terms of Use, modified 2026-07-29
- GitHub Advisory Database: [GHSA-8359-h9fx-j6v9](https://github.com/advisories/GHSA-8359-h9fx-j6v9), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2026-55389](https://nvd.nist.gov/vuln/detail/CVE-2026-55389), Public domain, modified 2026-10-23
- PyPA Advisory Database: [PYSEC-2026-3558](https://osv.dev/vulnerability/PYSEC-2026-3558), CC-BY-4.0, modified 2026-08-04

---

Page: https://cve.day/CVE-2026-55389 · Whole record: https://cve.day/CVE-2026-55389.json · Rebuilt by cve.day 2026-11-25T22:59:30.389Z
