Skip to content
SSRF Write-up Intermediate

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.

Frans Rosén Follow

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.

Frans Rosén (@fransrosen), on github.com

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

  1. Set up a redirect endpoint on an attacker-controlled HTTPS server that redirects to an internal HTTP URL.
  2. Send a POST request to the relay's /proxy endpoint with targethost set to the attacker's server and targetpath pointing to the redirect.
  3. 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.

More by Frans Rosén

View all

3 more disclosed reports, best first.

More from Cloudflare

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Server-side request forgery (SSRF)

The lesson behind this report.

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.