{"id":"CVE-2026-55389","published":"2026-07-28T21:49:21Z","modified":"2026-07-29T12:33:45Z","title":"datamodel-code-generator vulnerable to arbitrary local file read via JSON-Schema `$ref` (`file://` and `../`…","vendor":"koxudaxi","product":"datamodel-code-generator","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.5,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00547,"percentile":0.39424,"provenance":"source"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"},{"id":"CWE-200","name":"Exposure of Sensitive Information to an Unauthorized Actor"},{"id":"CWE-610","name":"Externally Controlled Reference to a Resource in Another Sphere"}],"references":[{"url":"https://github.com/koxudaxi/datamodel-code-generator/security/advisories/GHSA-8359-h9fx-j6v9","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/koxudaxi/datamodel-code-generator/commit/2ff4a72b4550a2b2069754c5b075b1655067e5fb","tags":["x_refsource_MISC"]},{"url":"https://github.com/koxudaxi/datamodel-code-generator/releases/tag/0.62.0","tags":["x_refsource_MISC"]}],"priority":{"score":13.1,"factors":[{"name":"EPSS percentile","points":7.88},{"name":"CVSS severity","points":5.25}]},"vendorSlug":"koxudaxi","affectedVersions":[{"vendor":"koxudaxi","product":"datamodel-code-generator","versions":["< 0.62.0"]}],"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"partial","timestamp":"2026-07-29T12:33:40.109394Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"datamodel-code-generator","vulnerableRanges":["<0.62.0"],"patched":["0.62.0"],"from":["GHSA-8359-h9fx-j6v9","PYSEC-2026-3558"],"provenance":"source"}],"summary":{"text":"An attacker who can supply a crafted JSON Schema to the tool can cause it to read arbitrary local files and expose their contents, with no authentication or user interaction required beyond the tool processing that input.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:34:10Z"},"euvd":{"id":"EUVD-2026-50078","exploited":false,"provenance":"source"}}