Definition
Security Assertion Markup Language (SAML) is an XML-based open standard for exchanging authentication and authorization data between an identity provider and a service provider, enabling single sign-on across domains.
People Also Ask
Common questions about SAML answered by our security experts.
SAML in Practice
SAML is the XML-based standard that carries authentication assertions between an identity provider and a service provider. It predates the modern web API era and remains the backbone of enterprise single sign-on, particularly for established business applications.
How the flow works
A user reaches an application, which redirects them to their identity provider. The provider authenticates them and returns a signed assertion stating who they are and, frequently, what groups or attributes they carry. The application validates the signature and establishes a session.
Everything therefore depends on that validation. The assertion arrives through the user's browser — which is under the user's control — so its trustworthiness comes entirely from the signature and the checks performed on it.
Signature validation has a difficult history
SAML implementations have repeatedly been found vulnerable to signature wrapping, where an attacker restructures the XML so that a validly signed element remains present while the assertion the application actually reads is attacker-controlled.
The underlying difficulty is XML canonicalisation: signing and parsing may disagree about which part of the document is authoritative. This is a strong argument for using a mature, maintained library rather than implementing validation, and for keeping that library current.
Beyond the signature, implementations must validate the audience, the expiry, and that the assertion has not been replayed. Each has been missing in real-world vulnerabilities.
Configuration is where most real problems sit
Beyond the protocol-level vulnerabilities, the recurring practical issues are mundane. Certificates used to sign assertions expire, and the resulting outage affects every user of the application at once, usually with an unhelpful error message.
Clock skew between provider and application causes intermittent failures that are difficult to diagnose, because assertions carry validity windows measured in minutes.
And metadata — the configuration describing endpoints and keys — is frequently exchanged once during implementation and never refreshed, so a key rotation at one end breaks the integration at the other.
Session handling after the assertion
SAML authenticates; what happens next is the application’s session, and that session is where the practical security lives. An assertion valid for five minutes that establishes a session valid for two weeks has moved the risk rather than removed it.
Single logout is the other frequently incomplete piece. The specification provides for ending sessions across all connected applications, implementations vary widely, and in practice signing out of the identity provider often leaves application sessions active.
That matters for shared devices particularly, where the next user may inherit a session the previous one believed they had ended.
The thing most worth getting right
Where an integration is being built new rather than maintained, OpenID Connect is generally the better choice for the reasons set out there — simpler validation, automatic key rotation and better fit with modern application architectures.
Where to start
For any application you integrate by SAML, confirm which library performs validation and whether it is current. Hand-rolled validation is where the historical vulnerabilities concentrate.
See SSO and session management. GuardsArm delivers application penetration testing.
Related Terms
Single Sign-On
Single Sign-On (SSO) is an authentication method that allows users to access multiple applications and services with one set of login credentials. SSO improves user experience, reduces password fatigue, and centralizes authentication management.
OAuth
OAuth is an open authorization framework that allows third-party applications to access user resources without exposing credentials, using token-based delegated access instead of sharing passwords.
Federated Identity
Federated Identity is a system that allows users to use the same credentials to access resources across multiple independent organizations or domains by establishing trust relationships between identity providers.
OpenID Connect
OpenID Connect (OIDC) is an identity layer built on top of OAuth 2.0 that allows applications to verify user identity and obtain basic profile information through a standardized authentication protocol.
Related Reading
SSO and Session Management for Healthcare Apps
Single sign-on solves the login. Session management is what decides whether the next person at that workstation is still signed in as you — and in a…
Identity Governance for Contractors: Avoiding Hidden Access Debt
Contractors, locums, students and vendor engineers arrive through doors HR never sees, so nothing tells the identity system when they leave. How to…
Speak With an Expert
Book a free consultation to discuss saml for your organization.
Related Services
Need Help With SAML?
Our certified security professionals can help you implement the right saml strategy for your organization. Get a free assessment today.