Security issues with cloudflare/odoh-server-go and the ODoH RFC draft
The ODoH relay implementation in cloudflare/odoh-server-go does not restrict the target host, content types, or redirects, allowing an attacker to make the relay send requests to internal hosts and read the responses. This enables SSRF, including access to cloud metadata services.
Published on github.com
I've been doing some research around ODoH (Oblivious DNS Over HTTPS) and I've identified some issues with the ongoing and running project at cloudflare/odoh-server-go as well as some issues with the RFC-draft itself lacking important security considerations.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The relay does not validate the target host, content types, or redirects, and lacks SSRF protections such as blocking internal IP ranges.
Impact
An attacker could read data from internal hosts, including AWS instance metadata, potentially obtaining security credentials.
What the attacker needed
Relay running cloudflare/odoh-server-go; attacker-controlled HTTPS redirect endpoint; relay can reach internal hosts
The fix
The relay should restrict content types, block redirects to non-HTTPS URLs, and block requests to internal hosts by default.
How it was found
- Set up a redirect endpoint on an attacker-controlled HTTPS server that redirects to an internal HTTP URL.
- Send a POST request to the relay's /proxy endpoint with targethost set to the attacker's server and targetpath pointing to the redirect.
- The relay follows the redirect and makes a request to the internal host, returning the response to the attacker.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
ODoH is a privacy protocol where a relay forwards encrypted DNS queries to a target resolver. The relay is supposed to only talk to that resolver, but this implementation lets anyone tell it to talk to any server, including internal ones. An attacker can use this to make the relay fetch sensitive internal data and return it.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.