datamodel-code-generator vulnerable to SSRF protection bypass via DNS rebinding
Summary
| CVE | CVE-2026-55391 |
|---|---|
| State | PUBLISHED |
| Assigner | GitHub_M |
| Source Priority | CVE Program / NVD first with legacy fallback |
| Published | 2026-07-28 22:17:48 UTC |
| Updated | 2026-07-30 19:07:59 UTC |
| 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.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. |
Risk And Classification
Primary CVSS: v3.1 7.5 HIGH from [email protected]
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:L/A:N
EPSS: 0.001970000 probability, percentile 0.096890000 (date 2026-08-01)
Problem Types: CWE-350 | CWE-367 | CWE-918 | CWE-350 CWE-350: Reliance on Reverse DNS Resolution for a Security-Critical Action | CWE-367 CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition | CWE-918 CWE-918: Server-Side Request Forgery (SSRF)
| Version | Source | Type | Score | Severity | Vector |
|---|---|---|---|---|---|
| 3.1 | [email protected] | Secondary | 7.5 | HIGH | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:L/A:N |
| 3.1 | CNA | DECLARED | 7.5 | HIGH | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:L/A:N |
CVSS v3.1 Breakdown
Attack Vector
NetworkAttack Complexity
HighPrivileges Required
NoneUser Interaction
NoneScope
ChangedConfidentiality
HighIntegrity
LowAvailability
NoneCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:L/A:N
Vendor Declared Affected Products
| Source | Vendor | Product | Version | Platforms |
|---|---|---|---|---|
| CNA | Koxudaxi | Datamodel-code-generator | affected < 0.63.0 | Not specified |
References
| Reference | Source | Link | Tags |
|---|---|---|---|
| gist.github.com/thegr1ffyn/c1d54dd6ff2a4c0d7d0dabe00c4985f4 | 134c704f-9b21-4f2e-91b3-4a467353bcc0 | gist.github.com | |
| github.com/koxudaxi/datamodel-code-generator/releases/tag/0.63.0 | [email protected] | github.com | |
| github.com/koxudaxi/datamodel-code-generator/security/advisories/GHSA-vx... | [email protected] | github.com | |
| github.com/koxudaxi/datamodel-code-generator/commit/25c8b7e497419eb20b23... | [email protected] | github.com | |
| CVE Program record | CVE.ORG | www.cve.org | canonical |
| NVD vulnerability detail | NVD | nvd.nist.gov | canonical, analysis |
No vendor comments have been submitted for this CVE.
There are currently no legacy QID mappings associated with this CVE.