Skip to content
SSRF Write-up Intermediate

[$$$ Bug Bounty Write Up] SSRF in OAuth Implementation of a Cli

The client application allowed users to set a custom OAuth Token URL, and the backend sent a POST request to that URL to exchange an authorization code for an access token. An attacker could point the Token URL to internal addresses, causing the server to make requests to localhost and enabling blind SSRF for internal port scanning.

Ahmed Fadel Follow

Published on medium.com

While hunting on a BBP, I discovered a Blind SSRF vulnerability in the OAuth implementation of a client application example.com . I was able to exploit it to perform internal port and host scanning.

Ahmed Fadel, 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

Root cause

Likely the application did not validate or restrict the user-supplied Token URL, allowing the backend to send requests to arbitrary internal or external addresses.

Impact

The vulnerability could be exploited for blind SSRF, allowing internal port and host scanning, but full-read SSRF was not achieved.

What the attacker needed

A free account on the target; ability to add a custom OAuth server; victim (or attacker) completes OAuth flow

The fix

The issue was resolved in April 2024, likely by validating or restricting the Token URL to prevent requests to internal addresses.

How it was found

  1. Create a custom OAuth server configuration (e.g., using Google Cloud Console) to obtain authorization and token URLs.
  2. Add the custom OAuth server to the client application, but replace the Token URL with a Burp Collaborator URL.
  3. Click 'Sign In' and complete authentication to trigger the backend request to the Token URL.
  4. Observe the request in Burp Collaborator, confirming the backend made an outbound request.
  5. Change the Token URL to http://[redacted] and repeat the sign-in process.
  6. Observe a stack trace error indicating the backend received a non-JSON response from localhost, confirming SSRF.

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.

OAuth is a way for websites to let you log in using another service, like Google. The application here let users configure their own OAuth server, including the address where the application's server would send a request to get an access token. Because that address was not checked, an attacker could make the server send requests to internal systems, which is called server-side request forgery (SSRF).

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.