Skip to content
OAuth / SSO Disclosed report Intermediate

Broken Authentication (including Slack OAuth bugs)

The report claims that Slack's OAuth redirect_uri validation could be bypassed using path traversal sequences, allowing an attacker to redirect the authorization code to an attacker-controlled site. The attacker could then use the stolen code to hijack the victim's account.

anandpingsafe Follow

Originally disclosed on HackerOne

  • Triaged in 9 hours
  • Fixed in 12 days
  • Paid in 12 days
  • Disclosed after 6 months

Hi,

Hope you are doing good! Please have a look at the below report. Description: OAuth Framework Flaw Bypassing redirect_uri validation An attacker to exploit this Flaw just needs to find a open redirection flaw in the site which is using Slack's OAuth for logins.

Impact: A malicious user can steal "code" parameter value assigned by Slack OAuth and can hijack victim's account by writing the value in a text file on his evilsite.com/a.php file. Steps to reproduce:

  1. Go to any web app which is using Slack's OAuth and click on Login with Slack
  2. You will be redirected to this URL

https://slack.com/oauth/authorize?client_id=...&scope=read,post&redirect_uri=https://www.givensite.com/../../redirect_url=https://www.evilsite.com/a.php%2Fcomplete Note i am bypassing the redirect_uri validation by using ../../ In the above URL,i have changed the value of redirect_uri to ../../redirect_url=https://www.evilsite.com/a.php and this should not happen.

The response will be http://givensite.com/redirect_url=https:/www.evilsite.com/a.php/complete?code=AQCbhUg1FiEQf5TyTesMgjP8zq

And then in the final step code value or access_token value will be written in my a.php file,the malicious guy will scrap it from the URL. So,then he can login into the victim account using code value. Please put proper validation on redirect_uri parameter.

The redirect_uri value should exactly match as defined in the application and the user to not be allowed to change it to the subdirectories etc.

This means if redirect_uri value is https://www.google.com then it should take the value https://www.google.com not https://www.google.com/a/x

Looking forward to hear from you,

Best regards, Anand

The original report as published on HackerOne, by anandpingsafe. 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

Impact

An attacker could steal the OAuth code and use it to hijack the victim's account, though the report does not demonstrate this against Slack itself.

What the attacker needed

A web app using Slack OAuth; an open redirect on that app; victim clicks a crafted link

The fix

The redirect_uri should be validated to exactly match a pre-registered value, without allowing subdirectories or path traversal.

How it was found

  1. Go to a web app that uses Slack OAuth and click Login with Slack.
  2. Modify the redirect_uri parameter in the authorization URL using path traversal to point to an attacker-controlled site.
  3. After authorisation, the code is sent to the attacker's site, where it can be captured.

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.

OAuth is a way for websites to let you log in using another service, like Slack. When you log in, Slack sends a secret code back to the website, and the website uses that code to confirm who you are. If an attacker can trick Slack into sending that code to their own website instead, they can use it to log in as you.

What is OAuth / SSO?

Mistakes in OAuth, OpenID Connect, SAML or token handling that leak codes and tokens or link an attacker's identity to a victim's account.

More by anandpingsafe

View all

19 more disclosed reports, best first.

More from Slack

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

OAuth and single sign-on flaws

The lesson behind this report.

Mistakes in OAuth, OpenID Connect, SAML or token handling that leak codes and tokens or link an attacker's identity to a victim's account.