CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-55391

CVE-2026-55391: Server-Side Request Forgery Bypass via DNS Rebinding in datamodel-code-generator

Alon Barad
Alon Barad
Software Engineer

Jul 29, 2026·6 min read·38 visits

Executive Summary (TL;DR)

A Time-of-Check to Time-of-Use (TOCTOU) DNS vulnerability in datamodel-code-generator allows remote attackers to bypass SSRF protections using DNS rebinding or IPv6-mapped IPv4 addresses, exposing internal networks.

CVE-2026-55391 is a server-side request forgery (SSRF) bypass vulnerability in the datamodel-code-generator package. The vulnerability occurs due to a Time-of-Check to Time-of-Use (TOCTOU) race condition during DNS resolution, combined with a failure to inspect embedded IPv4-in-IPv6 address mappings. By deploying a malicious DNS server with a low Time-To-Live (TTL) configuration, an attacker can bypass private address blocklists and coerce the application to connect to internal services or local endpoints.

Vulnerability Overview

The datamodel-code-generator package is a Python library used to generate structural structures, including Pydantic models, TypedDicts, and dataclasses, from remote schema definitions. To retrieve these definitions, the application supports fetching remote URLs when specified in the command-line interface or parsed as references within schemas. When the library is instructed to exclude private networks, a validation routine inspects the remote domain to confirm it resolves to a global, publicly routable IP address.

This implementation contains a fundamental vulnerability due to a Time-of-Check to Time-of-Use (TOCTOU) gap during network resolution. The library validates the target host during an initial DNS resolution phase but then relies on the underlying HTTP client library, which executes a second, independent DNS resolution during the socket connection phase. Because these phases are disconnected, a remote attacker can execute a DNS rebinding attack to bypass private network restrictions.

A secondary flaw also exists in how the validation engine processes IPv6-mapped IPv4 addresses. Specially constructed IPv6 structures mapping to local or private loops bypass the initial routability checks and allow connections to restricted endpoints.

Root Cause Analysis

The underlying vulnerability manifests in the get_body() function within src/datamodel_code_generator/http.py. When a target schema is fetched, the library employs a validation step to ensure that requested URLs resolve to global, public IP addresses before opening an HTTP connection. This security mechanism is intended to protect the host from Server-Side Request Forgery.

However, a severe Time-of-Check to Time-of-Use (TOCTOU) gap occurs. The validation step resolves the DNS domain name to verify its IP address using a standard socket call. Once validated, the library hands the raw string URL to the httpx HTTP client. The HTTP client then performs its own distinct DNS lookup to establish the actual network socket connection.

Because the DNS resolution is not pinned or cached between these two steps, an attacker can control the authoritative DNS server for the targeted domain. By specifying a Time-To-Live (TTL) of zero seconds, the attacker can return a safe, public IP during validation and a local or private IP during the connection phase. This forces the HTTP client to connect to local interfaces despite validation passing.

Additionally, the validation step relies on ip.is_global to flag unauthorized local IP addresses. However, IPv6 architectures allow embedding IPv4 targets inside IPv6 structures, such as mapped addresses (::ffff:127.0.0.1), compatible addresses (::127.0.0.1), or NAT64-mapped addresses. The operating system unrolls these to private targets, while standard library validation erroneously classifies the outer IPv6 shell as global.

Code Analysis

To understand the technical mechanics, consider the vulnerable logic flow. The application validated host targets by fetching IP arrays from the _get_ips_from_host function and verifying each IP using _is_safe_ip. This resolved DNS independently of the transport engine:

def _get_ips_from_host(host: str) -> tuple[IPv4Address | IPv6Address, ...]:
    # ...
    addr_infos = socket.getaddrinfo(host, None, ...)
    # ...

The fundamental issue was that after validating these IP instances, the library called httpx.get(current_url, ...) directly. It did not restrict httpx to the exact IP addresses that had just passed validation. This let httpx query DNS again during socket creation.

To remediate this, the developer implemented a custom transport backend that pins DNS resolution. The fixed transport uses the _PinnedNetworkBackend class to intercept connection attempts and enforce the use of pre-validated IP structures:

class _PinnedNetworkBackend:
    def __init__(
        self,
        *,
        pinned_host: str,
        pinned_ips: tuple[IPv4Address | IPv6Address, ...],
        backend: _NetworkBackend,
    ) -> None:
        self._pinned_host = _normalize_dns_host(pinned_host)
        self._pinned_ips = pinned_ips
        self._backend = backend
 
    def connect_tcp(
        self,
        host: str,
        port: int,
        # ...
    ) -> httpcore.NetworkStream:
        if _normalize_dns_host(host) != self._pinned_host:
            msg = f"Requested DNS host {host} does not match the validated host"
            raise OSError(msg)
 
        last_error: Exception | None = None
        for ip in self._pinned_ips:
            try:
                # Forces connection directly to the pre-validated IP address
                return self._backend.connect_tcp(
                    str(ip),
                    port,
                    timeout=timeout,
                    local_address=local_address,
                    socket_options=socket_options,
                )
            except Exception as exc:
                last_error = exc

This architecture forces the connection process to use the explicitly validated IPs, eliminating the TOCTOU gap entirely. Additionally, manual redirection loops were introduced so that any redirected targets must pass validation and pinning loops before access.

Exploitation

To initiate exploitation, an attacker configures an authoritative DNS server to manage a domain name under their control, such as rebound.attacker.com. The DNS server is programmed to return two different sets of IP addresses depending on the sequence or timing of incoming requests.

On the first query, which corresponds to the validation phase of datamodel-code-generator, the DNS server returns a public IP address. Because this public IP resolves to a globally routable resource, the validation checks succeed.

On the second query, which corresponds to the socket connection phase, the DNS server returns an internal IP address, such as 127.0.0.1 or the AWS link-local metadata address 169.254.169.254. Since the connection is initiated immediately after validation, the HTTP client connects directly to the internal endpoint.

By leveraging this sequence, an attacker can access sensitive configuration frameworks, metadata services, and databases running on loopback networks.

Impact Assessment

The impact of a successful SSRF attack via DNS rebinding is significant. If datamodel-code-generator is integrated into an enterprise microservice or an automated processing pipeline, the application could be used to extract highly sensitive structural data.

In cloud environments, this allow access to internal metadata APIs like the AWS/GCP Instance Metadata Service (IMDS). Attackers can request sensitive IAM credentials and session tokens, leading to potential cloud control plane compromise.

In local cluster deployments, the exploit can target internal resources that rely solely on network boundaries for security. Services that do not require authentication on localhost are especially vulnerable to manipulation and data exfiltration.

Remediation

To address this vulnerability, security administrators must upgrade datamodel-code-generator to version 0.63.0 or later. This version contains the socket pinning and address unwrapping mitigations.

If upgrading is not immediately possible, apply network-level controls. Configure outbound firewalls to block all traffic originating from the code-generation containers destined for internal subnets and metadata IP addresses.

Additionally, validation processes can be hardened by ensuring that remote references are fetched through an explicit gateway proxy. This proxy should perform its own strict DNS caching and enforce robust request boundaries.

Fix Analysis (1)

Technical Appendix

CVSS Score
7.5/ 10
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:L/A:N

Affected Systems

datamodel-code-generator python package

Affected Versions Detail

Product
Affected Versions
Fixed Version
datamodel-code-generator
koxudaxi
>= 0.50.0, < 0.63.00.63.0
AttributeDetail
CWE IDCWE-918 (SSRF), CWE-367 (TOCTOU)
Attack VectorNetwork
Attack ComplexityHigh
CVSS v3.1 Score7.5
Exploit StatusProof-of-Concept
CISA KEV StatusNot Listed

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1005Data from Local System
Collection
CWE-918
Server-Side Request Forgery (SSRF)

The web application receives a URL or similar identifier from an upstream source and retrieves the contents at that URL, but it does not sufficiently ensure that the request is being sent to the intended destination.

Vulnerability Timeline

Initial mitigation implementation completed
2026-06-10
IPv6 embedded unwrapping successfully merged
2026-06-11
Official release of version 0.63.0 containing the patch
2026-07-28

References & Sources

  • [1]Fix Commit

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 10 hours ago•CVE-2026-63304
8.1

CVE-2026-63304: OS Command Injection in WWBN AVideo via listFFmpegProcesses

WWBN AVideo versions through 29.0 contain an OS command injection vulnerability (CWE-78) in the standalone API utility function listFFmpegProcesses(). The function constructs a shell pipeline to monitor active FFmpeg processes by interpolating a user-controlled keyword parameter directly into a single-quoted grep argument without sanitization or shell escaping. An attacker capable of crafting or submitting a valid encrypted codeToExec payload can break out of the single-quoted argument context and execute arbitrary operating system commands with the privileges of the web server user.

Alon Barad
Alon Barad
5 views•9 min read
•about 11 hours ago•CVE-2026-59726
10.0

CVE-2026-59726: Unauthenticated Remote Code Execution in Ruflo MCP Bridge

Ruflo versions prior to 3.16.3 expose the Model Context Protocol (MCP) bridge HTTP endpoints (`POST /mcp` and `POST /mcp/:group`) on all network interfaces (`0.0.0.0:3001`) without authentication. Because the primary JSON-RPC tool dispatcher (`executeTool()`) bypasses existing tool blocklists, an unauthenticated network attacker can invoke the `terminal_execute` tool to achieve arbitrary command execution inside the bridge container. This initial access permits full exfiltration of third-party LLM provider API keys, unauthorized access to the co-located MongoDB instance, and manipulation of the AgentDB learning store.

Alon Barad
Alon Barad
11 views•2 min read
•about 12 hours ago•CVE-2026-59818
6.5

CVE-2026-59818: Improper Certificate Revocation List (CRL) Validation on Split gRPC Listeners in etcd

In etcd versions prior to 3.5.32 and 3.6.13, configuring the server with --listen-client-http-urls decouples HTTP and gRPC traffic onto distinct network listeners. Due to an implementation flaw in how TLS configurations are passed to the gRPC server instance, the Certificate Revocation List (CRL) defined by --client-crl-file is enforced exclusively on the HTTP listener and omitted entirely on the dedicated gRPC listener. This allows an adversary possessing a revoked, CA-signed client certificate to bypass mutual TLS (mTLS) revocation checks and authenticate directly to the gRPC interface.

Amit Schendel
Amit Schendel
6 views•10 min read
•about 13 hours ago•CVE-2026-59831
4.4

CVE-2026-59831: Remote Code Execution via Unvalidated URL Scheme Handling in GitHub CLI

GitHub CLI (gh) versions 2.10.0 through 2.95.0 contain an input validation vulnerability in the `gh codespace jupyter` command path. When connecting to a remote Codespace to launch a JupyterLab session, the CLI retrieves a server URL via a remote procedure call (RPC) and passes it directly to the host operating system's default URL dispatcher without validating the scheme or target host. A compromised or malicious Codespace can return a custom protocol URI, such as `vscode://` or `vscode-insiders://`, allowing an attacker to invoke local desktop application handlers and achieve arbitrary command execution on the developer's workstation.

Alon Barad
Alon Barad
13 views•9 min read
•about 14 hours ago•CVE-2026-59191
6.9

CVE-2026-59191: Path Traversal and Arbitrary File Read in CakePHP TwigView FileLoader

A path traversal vulnerability exists in the cakephp/twig-view plugin for the CakePHP framework prior to versions 1.3.3 and 2.1.2. The Cake\TwigView\Twig\FileLoader::findTemplate() method verifies template existence using PHP's native file_exists() function without ensuring the target path resides within configured application or plugin template directories. When user-controlled input is passed to template inclusion mechanisms, an unauthenticated remote attacker can read arbitrary local files accessible to the PHP runtime.

Alon Barad
Alon Barad
6 views•9 min read
•about 15 hours ago•CVE-2026-64855
8.2

CVE-2026-64855: Cryptographic Signature Verification Bypass in soapbar WS-Security Implementation

CVE-2026-64855 (GHSA-859w-52fx-hcm6) is a cryptographic signature verification and authentication bypass vulnerability in the soapbar Python library prior to version 0.13.0. In vulnerable versions, the verify_envelope_bsp() function derives its trust anchor directly from the incoming SOAP message by extracting an untrusted X.509 certificate embedded inside the wsse:BinarySecurityToken header. Because the function checks only the temporal validity of the extracted certificate without performing Certificate Authority (CA) chain validation or certificate pinning, an unauthenticated network attacker can generate a self-signed certificate, sign an arbitrary SOAP payload, and pass verification.

Amit Schendel
Amit Schendel
9 views•10 min read