Skip to content
SSRF Write-up Advanced

How I found tricky $$$$ Server-Side Request Forgery (SSRF)

The CMS image fetcher concatenated a user-supplied path onto a fixed base URL, allowing an attacker to fetch arbitrary external content and, via a redirect downgrade, reach internal services including cloud metadata. This led to stored XSS, account takeover, and full SSRF.

medium.com

Published on medium.com

During a recent hunting session I discovered an interesting SSRF that required nice tricks to fully exploit. It started with a CMS that dynamically fetches blog images via:

Abdelnour Osman (DarkT), on medium.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

Impact

An attacker could achieve stored XSS leading to account takeover and full SSRF to internal services and cloud metadata, escalating to critical severity.

What the attacker needed

Attacker-controlled domain with valid TLS; victim visits a crafted URL; application fetches and stores external content

How it was found

  1. Send a request to the image endpoint with a path that starts with a slash and points to an attacker-controlled domain.
  2. Observe that the server resolves the concatenated hostname, confirming host concatenation.
  3. Set up a domain with a valid TLS certificate to bypass SSL errors and fetch content.
  4. Host a malicious payload on the attacker domain and cause the application to fetch and store it, leading to stored XSS.
  5. Use a redirector to downgrade from HTTPS to HTTP and access internal services like [redacted] and cloud metadata.

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.

The website had a feature that fetched images from another server. Because it trusted user input to decide where to fetch from, an attacker could make it fetch from their own server and even from internal servers that are not normally reachable. This let the attacker steal accounts and access 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.

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.