CVE-2026-55391: datamodel-code-generator vulnerable to SSRF protection bypass via DNS rebinding
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.
Security readout for executives and security teams
Plain-English summary
A flaw in datamodel-code-generator can let an attacker-supplied URL evade private-network protections through DNS rebinding. A vulnerable service could then connect to internal systems, potentially exposing sensitive data or enabling limited modification. The affected condition is fixed in version 0.63.0.
Executive priority
Prioritize rapid remediation for internet-facing or multi-tenant services that generate models from user-supplied URLs and can reach internal networks. Other deployments should still upgrade promptly after confirming compatibility. The high severity reflects possible sensitive-data exposure, although exploitation requires a DNS timing condition.
Technical view
Before 0.63.0, URL validation resolves and checks the hostname once, but httpx resolves it again when connecting. An attacker can change the DNS answer between those operations, bypassing allow_private_network=False. This time-of-check/time-of-use flaw enables server-side request forgery into otherwise restricted networks.
Likely exposure
Exposure is most likely where versions earlier than 0.63.0 process attacker-controlled or untrusted remote URLs and run with network access to internal services. Installations using only trusted local inputs, or with effective outbound network isolation, have lower practical exposure.
Exploitation context
The source bundle lists a public exploit reference, indicating technical reproduction information may be available. However, the CVE is not listed as KEV, and the supplied sources do not establish active exploitation in the wild. Exploitation complexity is rated high.
Researcher notes
The weakness combines incomplete hostname validation, DNS rebinding, and a check-to-use race, corresponding to CWE-350, CWE-367, and CWE-918. Review should focus on trust boundaries around URL ingestion, secondary DNS resolution, and reachable internal assets. The supplied bundle does not quantify real-world affected deployments.
Mitigation direction
Upgrade datamodel-code-generator to version 0.63.0 or later.
Restrict remote URL inputs to trusted sources until upgrading.
Limit the generator's outbound access to internal services and sensitive network ranges.
Review the vendor advisory and release notes for deployment-specific guidance.
Validation and detection
Inventory installed datamodel-code-generator versions across development, CI, and hosted services.
Identify workflows that accept remote schemas or other URLs from untrusted users.
Confirm vulnerable workloads cannot reach internal services through outbound connections.
Verify upgraded environments report version 0.63.0 or later.
Review network logs for unexpected requests from systems running the generator.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-350: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
CWE-918: Information exposure and cloud metadata lookup
Information exposure and SSRF weaknesses can make discovery, cloud metadata, and credential material review relevant. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
The CVE wording references SSRF or metadata access, so cloud discovery and credential material review may help. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-350 · source CWE mapping
Reliance on Reverse DNS Resolution for a Security-Critical Action
Reliance on Reverse DNS Resolution for a Security-Critical Action represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.
Time-of-check Time-of-use (TOCTOU) Race Condition represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.
Server-Side Request Forgery (SSRF) represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.