Skip to content
SSRF Write-up Advanced

From ../ to open redirect

An open redirect and path traversal in a GraphQL proxy allowed server-side request forgery, and because the server forwarded the user's session cookies to the attacker-controlled endpoint, an attacker could steal a victim's cookies and take over their account.

Surajjjj Follow

Published on ninetyn1ne.github.io

While testing a web application, I discovered several vulnerabilities that, when chained together, could have allowed anyone to take over a victim’s account.

Suraj Disoja (@ninetyn1ne_), on ninetyn1ne.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 application failed to validate the user-supplied identifier used to construct a server-side request, allowing path traversal and an open redirect to redirect the request to an attacker-controlled host, and it also forwarded the user's cookies to that host.

Impact

An attacker could steal a victim's session cookies and take over their account by tricking the victim into following a crafted link.

What the attacker needed

Victim clicks a link; attacker-controlled server

The fix

The open redirect was fixed by disallowing root-style redirects, and the server was changed so that cookies were not forwarded to non-allowlisted domains during server-side requests.

How it was found

  1. Discover an open redirect by appending two slashes to the path.
  2. Notice a GraphQL mutation that sends an id variable as a string.
  3. Test for path traversal by adding ../ sequences to the id variable.
  4. Chain the traversal with the open redirect to make the server request an attacker-controlled endpoint.
  5. Observe that the server-side request includes the user's session cookies.
  6. Use a GraphQL query that can be triggered via GET to force a victim to send their cookies 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.

The application had a feature that made requests to other servers on the user's behalf. By manipulating a parameter, an attacker could make the server send the user's login cookies to a server the attacker controlled. With those cookies, the attacker could log in as the victim.

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 Surajjjj

View all

1 more disclosed report, 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.