Skip to content
OAuth / SSO Write-up Intermediate

SAMLjacking a poisoned tenant

An attacker can register a SaaS tenant they control and invite target users, then configure a malicious SAML server so that when users log in or link their accounts, they are redirected to a fake SSO page that captures their credentials. This can lead to compromise of the users' Google accounts and other SaaS applications.

Luke Jennings Follow

Published on pushsecurity.com

In this article, we’re going to demo combining two of our favorite new SaaS attack techniques to make a simple, but effective attack chain.

Luke Jennings, on pushsecurity.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 SaaS application allows tenant administrators to configure arbitrary SAML identity providers without verifying ownership or restricting redirect targets, and it automatically maps invited users to the tenant.

Impact

An attacker could capture users' Google credentials and potentially access all data in Google apps, other SaaS apps using the same Google account, passwordless logins, and account recovery, leading to compromise of every SaaS application accessible by the user.

What the attacker needed

Attacker controls a SaaS tenant; victim joins attacker's tenant; victim logs in or links account

The fix

Organisations should gain visibility into SaaS sprawl and ensure new apps or tenants are legitimate, but the text does not specify a technical fix for the SaaS provider.

How it was found

  1. Set up a poisoned tenant and invite target users via sharing links or email invitations.
  2. Target users respond to the invitation or later sign up, and are mapped to the attacker's workspace by default.
  3. Configure a malicious SAML server that mimics the target's SSO provider.
  4. Enable SSO requirement, which sends emails to existing users prompting them to link accounts to SSO.
  5. When users click the link or later log in, they are redirected to the malicious SAML server where credentials are 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 write-up has not been written yet. The Original tab links to the source.

This is about tricking people into joining a fake workspace on a real service, then changing the login settings so that when they sign in, they are sent to a fake login page that steals their password. The attacker can then use those stolen credentials to access the victim's email, files, and other apps.

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.