Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
SAML carries signed XML assertions about a user from an identity provider to an application, which is how most enterprise single sign-on has worked for twenty years.

What Is SAML?
SAML 2.0 has been an OASIS standard since 2005, which in protocol terms makes it venerable, and it still authenticates a large share of enterprise software. The Security Assertion Markup Language defines how one party makes a signed statement about a user and how another party verifies it—the mechanism behind the single sign-on experience in most HR systems, expense tools, and line-of-business applications bought before 2018.
The identity provider authenticates the user and issues an assertion: an XML document stating who the subject is, when the statement was made, how long it is valid, what conditions apply, and what attributes the user has. It is signed with the identity provider’s private key, usually with an X.509 certificate exchanged in advance through metadata.
The service provider receives the assertion, verifies the signature against the certificate it holds, checks the conditions, and creates a session. No password reaches the service provider, which is the entire point.
Two flows exist. In service-provider-initiated sign-on, the user visits the application, is redirected to the identity provider, authenticates, and returns with the assertion. In identity-provider-initiated sign-on, the user starts at a portal and is sent to the application with an unsolicited assertion. The second is convenient and weaker, because there is no request for the response to be correlated against, which removes a defence against replay and injection. Prefer service-provider-initiated flows wherever the application supports them.
Most SAML vulnerabilities are missing checks rather than broken cryptography. A service provider must confirm all of the following:
NotBefore and NotOnOrAfter bracket the current time, allowing minimal clock skew.Destination and recipient match this assertion consumer service URL.InResponseTo matches an authentication request this service provider actually issued.The attack class that has dogged SAML for fifteen years comes from a mismatch between the component that verifies the signature and the component that reads the data. An attacker takes a legitimate signed assertion, wraps it inside a crafted document, and adds a second assertion naming a different user. The signature verification library finds the original signed element and reports success; the application logic then reads the first assertion it encounters, which is the attacker’s.
Duo Security’s 2018 research found this pattern in multiple widely used SAML libraries, including a variant where XML comments inside the NameID element caused different parsers to extract different usernames—so [email protected] with a comment inserted could be read as a different account entirely. The lesson is to use a maintained library, keep it patched, and never process the assertion with a different parser from the one that validated it.
If an attacker obtains the identity provider’s token-signing private key, they can mint assertions for any user, with any attributes, at any time. No authentication occurs, no failed login is recorded, and conditional access policies evaluated at the identity provider are never consulted.
This is Golden SAML, and it was a component of the SolarWinds intrusion disclosed in December 2020, where on-premises AD FS signing certificates were stolen and used to access cloud services as arbitrary users. The defences are to store signing material in a hardware security module, rotate it on a schedule and immediately after any suspicion of host compromise, treat the federation server as a tier-zero asset, and alert on assertions with unusual lifetimes or issuers. Our entry on identity provider federation risks covers the wider picture.
For new work, OpenID Connect is easier to implement correctly: JSON rather than XML canonicalisation, better defined behaviour for mobile and single-page applications, and no XML signature processing to get wrong. SAML persists because thousands of enterprise applications support only SAML, and procurement cycles are long.
The pragmatic approach is a single identity provider that speaks both, translating between protocols so that your authentication policy, conditional access, and logging apply uniformly. Pair it with SCIM for provisioning, since SAML authenticates users but does not create or disable accounts in the target application—a gap that leaves leavers with working accounts in applications nobody deprovisioned.
At Privia Security, we test single sign-on integrations for signature wrapping and validation gaps in our web application security services.
No, though it is no longer the first choice for new development. Thousands of enterprise applications support SAML and nothing else, so most organisations will operate it for years. The practical approach is one identity provider that speaks both SAML and OpenID Connect, applying the same authentication policy and logging regardless of which protocol the application needs.
An attack where a valid signed assertion is embedded inside a crafted document alongside a forged one. The signature verification code finds the genuine signed element and reports success, while the application logic reads the attacker’s assertion instead. It is a mismatch between what is verified and what is used, and it has affected several widely deployed SAML libraries.
Because the assertion is unsolicited, there is no outstanding authentication request for the service provider to correlate it against. That removes the InResponseTo check, which is one of the defences against replaying or injecting a captured assertion. Use service-provider-initiated flows where the application supports them, and enforce assertion identifier replay protection in either case.
A technique in which an attacker who has stolen the identity provider’s token-signing private key forges assertions for any user at will. Because no authentication takes place, nothing appears in sign-in logs and conditional access is never evaluated. Protect signing keys in hardware, rotate them after any suspected host compromise, and monitor assertions for unusual issuers or lifetimes.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.