Skip to content
SSRF Write-up Intermediate

Question 1

A Searchblox web application exposed a file-reading endpoint that let an unauthenticated attacker read arbitrary files, including a configuration file containing an API key and password hashes. The API key allowed the attacker to create a collection and document that caused the server to fetch an external URL, which redirected to the AWS metadata endpoint, exposing cloud credentials.

hateshape Follow

Published on hateshape.github.io

I will start by saying I am not that smart. Never have been, never will be.

hateshape, on hateshape.github.io

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

Likely the file-serving endpoint failed to restrict the 'url' parameter to web URLs and did not sanitise path traversal, and the API key was stored in a readable configuration file with excessive privileges.

Impact

An unauthenticated attacker could read arbitrary files, obtain an API key with super admin privileges, and use the server to fetch AWS metadata, potentially exposing cloud credentials.

What the attacker needed

None

How it was found

  1. Find a URL with a 'url' parameter and test it with a local file path to confirm file inclusion.
  2. Read the Searchblox configuration file to obtain the API key and password hashes.
  3. Use the API key to create a new collection via the REST API.
  4. Add a document to the collection that points to an external server controlled by the attacker.
  5. Configure the external server to redirect all requests to the AWS metadata endpoint.
  6. Search the indexed content in the web UI to view the retrieved AWS metadata, including credentials.

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 application had a feature that let users specify a file path, and it did not check that the path was safe, so anyone could read any file on the server. One of those files held a secret key that gave high-level access. The attacker used that key to make the server fetch a web address they controlled, which redirected to a special cloud address that holds sensitive login information, and the server then displayed that information in its search results.

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 hateshape

View all

3 more disclosed reports, best first.

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.