Skip to content
OAuth / SSO Write-up Intermediate

Authentication bypass due to weak verification of SAML Token

The application failed to properly validate the SAML token and instead extracted the username from it, allowing an attacker to change the username to impersonate any user, including administrators. After an initial fix encrypted the username, the attacker found that the application still accepted a modified username from the SAML token and re-encrypted it, enabling the bypass again.

accorian.com

Published on accorian.com

The web application vulnerability – authentication bypass occurs when there is improper validation of the user’s identity on the server-side.

IT Support, on accorian.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 service provider did not verify the SAML token's signature or integrity, and instead extracted the username directly from the token to authenticate the user.

Impact

An attacker with knowledge of a valid username could log in as any user, including administrators, leading to full account takeover.

What the attacker needed

Knowledge of a valid username; ability to intercept and modify requests

How it was found

  1. Log into the Okta dashboard with valid credentials and click on the target application to initiate SAML login.
  2. Intercept the SAML response request using Burp Suite.
  3. Change the username value in the SAML token to a different user's username.
  4. Send the modified request and observe successful login as the other user.
  5. After the first fix, decode the SAML token (URL decode then Base64 decode) to obtain XML data containing the username.
  6. Modify the username in the decoded XML, re-encode it, and send the request to log in as the new user.

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.

SAML is a way for one website (the identity provider) to tell another website (the service provider) that a user has logged in. The service provider should check that the message really comes from the identity provider and hasn't been changed. Here, the service provider just read the username from the message and trusted it, so anyone could change the username and log in as someone else.

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.