Skip to content
OAuth / SSO Write-up Advanced

$15,500 for Moving a Signature to the Wrong Node: SAML XML Signature Wrapping

The service provider verified the XML signature on the original signed assertion but then read the user identity from a different, unsigned assertion placed earlier in the document. An attacker with any validly signed assertion could therefore impersonate any identity-provider account, including administrative ones.

T4nv1 Follow

Published on medium.com

SAML authentication is built around a guarantee that sounds airtight: an identity provider cryptographically signs an assertion stating who a user is, and the service provider verifies that signature before trusting the assertion’s contents. The guarantee holds exactly as long as the service provider verifies the…

T4nv1, 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 service provider verified the signature against the correctly referenced assertion but then retrieved the NameID from a separate document query that did not enforce it operated on the same signature-verified element.

Impact

An attacker with any validly signed assertion for any account could impersonate any identity-provider account, including administrative accounts.

What the attacker needed

A validly signed SAML assertion for any account; ability to submit a modified SAML response

The fix

The service provider was patched to bind identity extraction to the verified element, and the team audited their SAML library version against known wrapping-attack advisories.

How it was found

  1. Capture a genuine signed SAML response from a test identity provider account and decode the base64 XML.
  2. Move the original signed assertion inside a new wrapper element and insert an unsigned assertion with a different NameID at the top level.
  3. Base64-encode the modified response and submit it to the assertion consumer service endpoint.
  4. Observe that the session is established as the identity in the unsigned assertion.

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.

When you log in with single sign-on, the identity provider sends a signed message saying who you are. The service provider is supposed to check that signature and then read your name from the same signed message. Here it checked the signature on one message but read the name from a different, unsigned one, so an attacker could put any name they liked in the unsigned copy.

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 T4nv1

View all

113 more disclosed reports, best first.

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.