DNS Rebinding in Draw.io ProxyServlet Allows Cloud Metadata and Internal Network Bypass
A server-side request forgery vulnerability has been disclosed in the proxy functionality of draw.io, enabling attackers to bypass private IP blocklists via DNS rebinding. The vulnerability manifests specifically in deployments where the proxy feature is activated through the `ENABLE_DRAWIO_PROXY=1` configuration flag. The root cause lies in how the application performs domain name resolution across two distinct execution stages without maintaining shared state. When handling an incoming request, the `Utils.sanitizeUrl()` method first invokes `InetAddress.getByName(host)` to confirm that the destination IP does not belong to private or restricted network blocks. Once the sanitization check completes successfully, execution flows to `ProxyServlet`, which instantiates a fresh `URL` object and invokes `url.openConnection()`. This operation initiates a completely independent, secondary DNS resolution process within the JVM. An attacker controlling an authoritative nameserver configured with a Time to Live (TTL) of zero can serve a benign public IP address during the initial validation check. The attacker then rapidly flips the DNS record to an internal IP address before the second lookup executes. Because the JVM's DNS caching TTL can be configured as low as zero, this race condition is reliably exploitable in practice. Successful exploitation allows attackers to force the server to issue HTTP requests to internal endpoints such as the cloud instance metadata service at `169.254.169.254`. The application subsequently base64-encodes the fetched response body and returns it directly to the requester. This behavior permits the exfiltration of sensitive cloud tokens, such as AWS IMDSv1 temporary IAM credentials or GCP service account tokens, as well as the probing of intranet services.
Read more about DNS Rebinding in Draw.io ProxyServlet Allows Cloud Metadata and Internal Network Bypass