SAML Username Collision Leading to Full ATO
The application mapped a SAML assertion's username attribute directly to a local account by name, without checking that the local account was linked to the SAML directory. An attacker with a trusted IdP account whose username matched a local account, such as the default Admin, could obtain a fully authenticated session for that local account without its password or MFA.
I was testing an application that supported both local accounts and SAML-based SSO. Nothing looked obviously broken.
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 application resolved the local account using only the mutable username from the SAML assertion, without verifying that the account was provisioned from or linked to the active SAML directory.
Impact
An attacker could obtain a full authenticated session for a local account, including the administrator, without knowing its password and without an MFA challenge, because the SAML login path issued a session immediately.
What the attacker needed
A trusted IdP account; control over the username attribute; a matching local account name
The fix
The application should bind federated identities to local accounts using a stable, directory-scoped identifier and reject authentication when the resolved local account is not linked to the active SAML directory.
How it was found
- Authenticate through a trusted identity provider with a SAML assertion carrying the username Admin.
- The application validates the assertion signature, which passes because the identity provider is trusted.
- The application extracts the username and queries local accounts by that name.
- It finds the local Admin account and creates a fully active session for it.
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 a company to let another service (the identity provider) confirm who a user is. The application checked that confirmation was genuine, but then looked up a local account by name alone. If the name matched an existing local account, the attacker got that account's session, even though the two accounts were never meant to be the same person.
What is Account takeover?
Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.