← Lab /Security & privacy

SAML is fundamentally flawed and should be replaced by OpenID Connect

SAML's design flaws make it insecure and unsuitable for modern use, recommending deprecation in favor of OIDC

Security & privacy Trail of Bits 21 Sep 2026 Explainer Theory

Published as “SAML: A fractal of bad design”

Summary

The post reviews the history and design of SAML, highlighting its reliance on complex XML and associated attack surfaces such as XML signature wrapping, canonicalization bugs, and enveloped signatures. It argues that these issues, combined with protocol ossification, make SAML insecure and hard to maintain. The author recommends migrating to OpenID Connect, citing its simpler JSON format and modern design. Evidence is anecdotal and based on past research papers and industry observations rather than new empirical data.

What they found 1

  1. XML signature wrapping attacks are a core weakness of SAML

    “XML signature wrapping (XSW) attacks are the proverbial arrow to SAML’s heel.”

Caveats 2

  • SAML had a good 25 year run. It birthed the SSO industry, helped secure untold numbers of authentications, improved the UX of authenticating to dozens of web services, and created billions of dollars of economic impact.
  • In the interest of staying on topic, I will refrain from doing that here, and suffice to say that XML is significantly more complex than something like JSON.

What’s new here 4

  • Identifies XML signature wrapping (XSW) as a critical vulnerability in SAML
  • Points out canonicalization bugs that enable XML comment bypass attacks
  • Describes how enveloped signatures complicate secure signing in XML
  • Calls for deprecation of SAML in favor of OIDC for modern SSO deployments