Field Notes
A small, source-linked blog

2026-09-21 · AI-assisted

Understanding SAML Architecture, Origins, and Security Risks

This article examines the design origins, security mechanics, and architectural limitations of Security Assertion Markup Language (SAML), contrasting it with modern alternatives like OpenID Connect (OIDC).

According to a Trail of Bits Blog post, the Security Assertion Markup Language (SAML) authentication protocol was created in 2002 by the OASIS Security Services Technical Committee. The specification combined four separate XML-based security protocols: Netegrity's S2ML, Securant's AuthXML, VeriSign's X-TASS, and Jamcracker's ITML.

Origins and Architectural Design

The protocol emerged during an era that predated widespread HTTPS dominance. Because direct network connections between the Identity Provider (IdP) and Service Provider (SP) were not always assumed, SAML was designed to be transport-independent. This contrasts with OpenID Connect (OIDC), which assumes a connected network topology using HTTPS and grew organically over time through modular specifications and RFCs.

XML Attack Surface and Signature Mechanics

The source highlights that SAML relies heavily on XML parsers and canonicalization (C14N). Before processing SAML logic, parsers must defend against several pre-existing bug classes, including XML External Entity (XXE) injections, entity expansion attacks such as the "billion laughs" exploit, Document Type Definition (DTD) retrieval leading to Server-Side Request Forgery (SSRF), and injection vulnerabilities affecting XPath, XQuery, XInclude, XSLT, and CDATA.

A primary vector against these implementations is XML Signature Wrapping (XSW). The source notes a prominent 2012 paper titled "On Breaking SAML: Be Whoever You Want to Be," which tested theory against practice and established automated checking for these flaws.

Furthermore, in SAML, the cryptographic signature element is inserted directly inside the data payload (the Assertion element) being signed, creating an enveloped signature. This differs from OIDC and JSON Web Tokens (JWT), where signatures are detached and delimited by a period.

Why Developers Care

Developers working with identity protocols face maintenance challenges due to legacy XML-based systems. The source points out that SAML's reliance on complex XML canonicalization rules and underlying C codebases like libxmlsec can lead to parsing differentials and signature bypasses.

As a practical alternative, organizations can choose to adopt OIDC. The source indicates that OIDC offers cleaner payload handling, direct backchannel communication, and transport reliance on HTTP/TLS. Companies such as Fly.io and Tailscale are cited as examples of organizations that maintain OIDC integration and avoid implementing SAML.

Limitations

When evaluating the source material, developers should note specific constraints:

Sources