Slack integration setup lacks CSRF protection
The Slack integration OAuth flow lacked CSRF protection at its start, so an attacker could initiate the flow and connect their own Slack account to a victim's HackerOne account if the third-party OAuth provider had an XSS, login CSRF, or clickjacking vulnerability. This could lead to account takeover if more integrations were added.
Originally disclosed on HackerOne
- Triaged in 3 days
- Fixed in 5 days
- Paid in 10 days
- Disclosed after 4.8 years
Details: Summary:
Cross-site Request Forgery in the Integrations (https://hackerone.com/[YOUR_TEAM]/integrations) feature for teams.
Description (Include Impact):
The Integrations flow is insecure, because it can be abused by CSRF.
PoC:
Request
GET https://hackerone.com/auth/slack HTTP/1.1
Response
Location: https://slack.com/oauth/authorize
?client_id=2174110321.11522100978
&redirect_uri=https%3A%2F%2Fhackerone.com%2Fauth%2Fslack%2Fcallback
&response_type=code
&scope=incoming-webhook
&state=379fd8f1baa8d80516e2f706f025057ad0ce2cca0bbbd56c
How can it be bad since you are using state parameter?
You are trusting in third-party security that is not under your control. All the attacker needs is an XSS or Login CSRF or Clickjacking in the third-party system and he can compromise your system. With one of the previous mentioned vulnerabilities in the third-party system, the attacker can control the entire OAuth flow and connect his own accounts to the victim's HackerOne account.
Today, you have just one integration available (Slack). If you implement more integrations in the future, the damage and the attack surface will grow significantly. Worst if you implement someday something like Login with Facebook / Login with Google / etc., because this bug will lead to account takeover.
Fix:
- Protection against CSRF at the beginning of the OAuth flow:
e.g.:
GET https://hackerone.com/auth/slack?CSRF_TOKEN=bdea53bd9a8c73bd983847 HTTP/1.1
Phabricatorapproach of OAuth connections (a confirmation dialog after the end of the OAuth flow). Picture attached (F121473).
P.S.: Are you interested in Login XSRF in HackerOne? How do you protect users against Login XSRF in your SSO flow? Sorry, I can not fully test SSO because I need approval of SSO configuration every time.
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
Root cause
Likely the OAuth flow initiation endpoint did not require a CSRF token, relying only on the OAuth state parameter which protects the callback but not the initial request.
Impact
An attacker could connect their own Slack account to a victim's HackerOne account, and if more integrations were added this could lead to account takeover.
What the attacker needed
Attacker has a Slack account; third-party OAuth provider has XSS, CSRF, or clickjacking
How it was found
- The attacker sends a request to the Slack authentication endpoint.
- The server responds with a redirect to Slack's OAuth authorization page.
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.
This report says the first step didn't check the request came from you, so an attacker could start the process and link their Slack account to your HackerOne account.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.