Skip to content
OAuth / SSO Write-up Intermediate

OAuth Integration Hijack via Predictable state Parameter

The OAuth integration used a predictable state parameter derived from the project ID instead of a random value, and did not bind the request to the user's session. An attacker could link their own third-party account to a victim's project, potentially accessing data or performing actions within the victim's account.

medium.com

Published on medium.com

Hey there! I’m Kariem Gamal, a bug hunter and penetration test.

Kariiem Gamal, 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

The state parameter was predictable (based on the project ID) and not tied to the user's session, so the OAuth callback could be forged.

Impact

An attacker could link their third-party account to the victim's project, potentially leading to data exfiltration, privilege escalation, or account manipulation, though the text does not confirm these were actually achieved.

What the attacker needed

Victim's project ID known or guessable; victim completes OAuth callback; attacker has a third-party account

The fix

The state parameter should be a cryptographically secure random value, bound to the user's session, and properly verified on callback.

How it was found

  1. Obtain the victim's project ID, either by being a low-privilege member of the organisation or through leaks.
  2. Start the OAuth flow on the attacker's own third-party account, changing the state parameter to match the victim's project ID.
  3. Intercept the OAuth callback.
  4. Force the victim to complete the callback using their own session, which links the attacker's third-party account to the victim's project.

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 one app to ask another app for permission to access your data without sharing your password. The 'state' parameter is meant to be a random code that proves the request came from you, but here it was just the project ID, which others could guess or find. This let an attacker trick the system into connecting their own account to someone else's project.

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.

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.