Skip to content
SSRF Disclosed report Intermediate

SSRF on duckduckgo.com/iu/

The image proxy endpoint checked for the allowed domain by looking for the string anywhere in the URL rather than validating the actual host, so an attacker could point it at arbitrary hosts. This allowed requests to localhost, a port scan of internal services, and disclosure of a Redis status page.

d0nut Follow

Originally disclosed on HackerOne

  • Triaged in 7 hours
  • Fixed in 45 hours
  • Disclosed after 17 days

Normally, a call to https://duckduckgo.com/iu contains a query parameter (u) with some path using the domain yimg.com. This call will succeed in most cases.

yimg_ok.png
yimg_ok.png From the original on HackerOne

And if we change that path to something like https://google.com it's rejected.

google_not_allowed.png
google_not_allowed.png From the original on HackerOne

However, it appears that the check that ensures that yimg.com is the target domain is solely based on whether or not that string appears in the url, independent of where. This means we can stuff it in a query parameter and bypass this check.

query_param_bypass.png
query_param_bypass.png From the original on HackerOne

Furthermore, with this bypass we can hit localhost and perform a port scan (see XSPA).

For example, I have been able to conclude that services are running on the following ports:

22
25
80
443
587
6380
6432
6767
6868
8000

Some of these services don't like talking HTTP (like 22 and 25) so they never respond, but other services seem to talk HTTP and will return seemingly sensitive data about redis. For example: https://duckduckgo.com/iu/?u=http://127.0.0.1:6868%2fstatus%2f?q=http://yimg.com/ returns the following:

{
  "current_time": "2018-08-23T17:56:06",
  "deployment_environment": "prod",
  "redis_local_last_successful_ping": "2018-08-23T13:56:05",
  "redis_local_url": "redis://127.0.0.1:6380",
  "redis_regional_last_successful_ping": "2018-08-23T13:56:05",
  "redis_regional_url": "redis://cache-services.duckduckgo.com:6380",
  "stat_blocked_ips_removed_since_launch": 8787,
  "stat_blocked_ips_since_launch": 12185,
  "stat_ipset_blocks": 266,
  "stat_redis_local_messages_received": 3613,
  "stat_redis_regional_messages_received": 10211,
  "status": "up"
}

Impact

This could be used to interact with services that are not intended to be exposed. This also enables an XSPA attack. Additionally, information disclosure about a redis service.

Lastly, an attack on redis may be possible even though the requests seem restricted to http.

Attachments

ports_1.png
ports_1.png From the original on HackerOne
ports_2.png
ports_2.png

The original report as published on HackerOne, by d0nut. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the allow-list check searched for the permitted domain as a substring anywhere in the URL instead of parsing the URL and comparing the actual host.

Impact

An attacker could interact with internal services not meant to be exposed, perform a cross-site port attack, and read sensitive Redis status information; the author notes an attack on Redis may be possible even though requests seem restricted to HTTP.

What the attacker needed

Ability to send requests to the image proxy

How it was found

  1. Send a request to the image proxy with the usual allowed domain in the query parameter and confirm it succeeds.
  2. Replace the target with another domain and observe that it is rejected.
  3. Add the allowed domain as an extra query parameter so the substring check passes while the real target is different.
  4. Point the request at localhost ports to see which services respond.
  5. Request the internal status endpoint and read the returned Redis information.

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 report has not been written yet. The Original tab links to the source.

A web server sometimes fetches a URL on your behalf, for example to resize an image. If it does not carefully check where it is allowed to fetch from, you can ask it to fetch internal addresses that outsiders cannot reach. Here the check only looked for an allowed domain name somewhere in the address, so adding it as an extra parameter let the server be pointed at its own internal services.

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 d0nut

View all

2 more disclosed reports, best first.

More from DuckDuckGo

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.