{"id":"CVE-2026-55391","published":"2026-07-28T21:45:39Z","modified":"2026-07-29T13:30:14Z","title":"datamodel-code-generator vulnerable to SSRF protection bypass via DNS rebinding","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.63.0, datamodel-code-generator validates a URL host once in src/datamodel_code_generator/http.py through get_body, _validate_url_for_fetch, and _get_ips_from_host, but then lets httpx resolve the host again for the connection, allowing DNS rebinding to bypass allow_private_network=False and reach internal services. This issue is fixed in version 0.63.0.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.5,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:L/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00305,"percentile":0.15745,"provenance":"source"},"cwes":[{"id":"CWE-350","name":"Reliance on Reverse DNS Resolution for a Security-Critical Action"},{"id":"CWE-367","name":"Time-of-check Time-of-use (TOCTOU) Race Condition"},{"id":"CWE-918","name":"Server-Side Request Forgery"}],"references":[{"url":"https://github.com/koxudaxi/datamodel-code-generator/security/advisories/GHSA-vx7x-vcc2-c44g","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/koxudaxi/datamodel-code-generator/commit/25c8b7e497419eb20b230fa3318c04f9bebc5a6f","tags":["x_refsource_MISC"]},{"url":"https://github.com/koxudaxi/datamodel-code-generator/releases/tag/0.63.0","tags":["x_refsource_MISC"]},{"url":"https://gist.github.com/thegr1ffyn/c1d54dd6ff2a4c0d7d0dabe00c4985f4","tags":["exploit"]}],"priority":{"score":13.4,"factors":[{"name":"EPSS percentile","points":3.15},{"name":"Public exploit code","points":5.0},{"name":"CVSS severity","points":5.25}]},"vendorSlug":"koxudaxi","affectedVersions":[{"vendor":"koxudaxi","product":"datamodel-code-generator","versions":["< 0.63.0"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2026-07-29T13:29:52.729955Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"datamodel-code-generator","vulnerableRanges":["<0.63.0"],"patched":["0.63.0"],"from":["GHSA-vx7x-vcc2-c44g","PYSEC-2026-3565"],"provenance":"source"}],"summary":{"text":"The datamodel-code-generator product from koxudaxi has a flaw in its HTTP fetch logic in src/datamodel_code_generator/http.py, where a URL's host is validated once and then resolved again when the connection is made. An attacker who can get the tool to fetch a URL they control, and who can serve DNS that changes its answer between those two lookups, can bypass the allow_private_network=False protection and reach internal services; exploitation requires a high-complexity race-style setup and no authentication, and the attack is network-based and needs no user interaction.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:31:15Z"},"euvd":{"id":"EUVD-2026-50076","exploited":false,"provenance":"source"},"exploitRefs":["https://gist.github.com/thegr1ffyn/c1d54dd6ff2a4c0d7d0dabe00c4985f4"]}