$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.
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…
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
- Capture a genuine signed SAML response from a test identity provider account and decode the base64 XML.
- Move the original signed assertion inside a new wrapper element and insert an unsigned assertion with a different NameID at the top level.
- Base64-encode the modified response and submit it to the assertion consumer service endpoint.
- 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.