<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/saml-a-fractal-of-bad-design-6cl53ggxw" -->

---
title: SAML: A fractal of bad design | daily.dev
description: SAML, the XML-based authentication protocol behind the SSO industry, is argued to be fundamentally broken due to its reliance on XML's complexity,...
canonical: https://daily.dev/posts/saml-a-fractal-of-bad-design-6cl53ggxw
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: SAML: A fractal of bad design | daily.dev
og:description: SAML, the XML-based authentication protocol behind the SSO industry, is argued to be fundamentally broken due to its reliance on XML's complexity,...
og:url: https://daily.dev/posts/saml-a-fractal-of-bad-design-6cl53ggxw
og:image: https://api.daily.dev/og/posts/6cL53GGXW.png
og:image:alt: SAML: A fractal of bad design
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# SAML: A fractal of bad design

**[Lobsters](https://daily.dev/sources/lobsters)** · 13 min read · 1 upvotes · 0 comments

## Summary

SAML, the XML-based authentication protocol behind the SSO industry, is argued to be fundamentally broken due to its reliance on XML's complexity, canonicalization pitfalls, enveloped signatures, kitchen-sink design, and protocol ossification. These structural issues underlie recurring signature-wrapping and parser-differential vulnerabilities found across libraries and vendors from 2012 through 2025, including recent bypasses affecting GitHub Enterprise. The piece traces SAML's origins in early-2000s academia and enterprise IT, contrasts it with OpenID Connect's simpler JSON-based, detached-signature, organically-evolved design, and recommends that both service providers and identity providers migrate away from SAML toward OIDC, citing Fly.io and Tailscale as companies already avoiding SAML.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.trailofbits.com/2026/09/21/saml-a-fractal-of-bad-design>

## Questions this post answers

### Why is SAML considered less secure than OpenID Connect for single sign-on?

SAML's security problems stem from its foundation on XML, which requires canonicalization (C14N) to produce consistent byte representations for signature validation, and uses enveloped signatures where the signature is embedded inside the data it signs. These factors repeatedly enable XML signature wrapping and parser differential attacks, such as the 2018 XML comment bypass and 2025 bypasses affecting GitHub Enterprise, whereas OIDC's JSON-based JWTs use simpler detached signatures.

_daily.dev surfaces security research like this for teams deciding whether to keep supporting SAML._

### What are XML signature wrapping (XSW) attacks in SAML authentication?

XML signature wrapping attacks exploit the difficulty of achieving byte-for-byte canonical consistency in XML, letting attackers insert forged elements that pass signature validation while altering the assertion's meaning. First systematically documented in the 2012 paper 'On Breaking SAML: Be Whoever You Want to Be,' the bug class remains present today, with new bypasses published as recently as 2025 targeting libxml2 and other parsers.

_engineers auditing SSO implementations follow ongoing SAML vulnerability research on daily.dev._

### Should a new SSO integration use SAML or OpenID Connect?

New SSO integrations should use OpenID Connect rather than SAML. OIDC avoids XML's complexity and canonicalization bugs by using JSON with detached JWT signatures, evolved organically through many targeted RFCs (like PKCE and DPoP) rather than being designed up front, and companies such as Fly.io and Tailscale already support only OIDC while refusing SAML integrations.

_teams weighing SSO protocol choices track OIDC versus SAML guidance on daily.dev._

## Community take

How the wider developer community reacted, aggregated from 3 discussions and 356 comments across lobsters, hackernews (as of 2026-09-23).

**TL;DR:** Developers overwhelmingly agree SAML's design (embedded XML signatures, canonicalization, algorithm confusion) is a security nightmare, with many sharing horror stories of real vulnerabilities, though some push back that judging SAML by today's standards is unfair given XML's dominance circa 2002, and enterprise inertia keeps it alive regardless.

**Sentiment:** 10% positive · 25% mixed · 65% skeptical

**The case for**

- Some argue SAML made engineering sense in 2002 when XML was the obvious, simple-seeming choice and alternatives like ASN.1 weren't clearly better.
- SAML still supports IdP-initiated flows and other enterprise-specific features that OIDC handles less consistently or not at all.
- Enterprise customers often already have working SAML setups, so vendors that support it avoid friction with large buyers.

**The pushback**

- Signed XML/XMLDSIG is described as fundamentally flawed because it signs a mutable DOM tree rather than a byte sequence, enabling signature-wrapping attacks.
- Real-world implementations have shipped catastrophic bugs, like accepting attacker-controlled HMAC passwords or trusting any valid signature regardless of which document content it covers.
- SAML bundles too many redundant options (multiple signing/encryption orderings) which multiplies the attack surface.
- JWT/OIDC has its own historical footguns (alg:none, HMAC-as-pubkey confusion) though considered less severe than SAML's problems overall.
- IdP-initiated flows without proper safeguards are vulnerable to login CSRF, and OIDC's spec guidance on preventing this is seen as hand-wavy by some.

**By community**

- hackernews (heated): Strong technical consensus that SAML/XMLDSIG is a security disaster, but vigorous side debates over whether XML was a fair choice in 2002, how OIDC/JWT compare, how widely SAML is still required in enterprise, and whether Tailscale's OIDC-only stance is representative.
- lobsters (mixed): No substantive discussion content was provided for this source.

**Hottest debate:** Whether it's fair to judge SAML's XML-based design as an obvious mistake in hindsight versus a reasonable engineering choice for its era, and how essential SAML support still is for enterprise sales versus companies like Tailscale that skip it entirely.

**Open questions**

- Why haven't OIDC's dynamic discovery and dynamic client registration features, which could enable true federated login, seen wider adoption?
- Will enterprises meaningfully migrate away from SAML given inertia, sunk costs, and IdP-initiated flow requirements, or will SAML persist indefinitely alongside OIDC?

**Highlights**

> My favourite SAML horror story, is that it used to be, that by default the main c implementation of xmlsig would not just check the sig with the public key specified but would also: - check it against an hmac using a password specified in the attacker controlled document. - check the signature using web pki (so the attacker could sign the saml document with their TLS key for their own personal domain and it would always be considered valid) I honestly dont know how sites with saml arent getting hacked all the time. The only thing worse than the absolute terrible standards are the absolute terrible implementations.
> — [bawolff on hackernews · 3 comments](https://news.ycombinator.com/item?id=49808446)

> It really probably is the worst security specification ever written.
> — [tptacek on hackernews · 3 comments](https://news.ycombinator.com/item?id=49808631)

> XML did not become more complex following 2002. DTD, Namespaces, Comments, processing instructions, CData, attribute vs. child dichotomy - all of these things exited from day 0. XML Schema (just like JSON schema) did not. When we're talking about a "simple format" in terms of security we are talking about parsing footguns like these features, not about complexities that may exist with any wire format such as schema and data validation. Were there any better formats for simple messages back in 2002? I would argue that yes. 1. ASN.1 is horribly complex, but PKCS #7 (Cryptographic Message Syntax, a.k.a. CMS) was already established, and it was better than XML Signatures in one regard: it did not try to fuse the signed content with its envelope. But this probably wasn't he best choice. 2. If all you needed is a bag of keys and values, you could easily go with an RFC 822 style header + values format (which worked well for both email protocols and HTML). As a bonus S/MIME was already well established at this point, so you had an obvious way to sign this data. 3. Simple binary formats like XDR (used by NFS) or simple textual formats like LDIF or the RFC 822 header format mentioned above could be freely combined with any existing signature protocol that did not mandate structured data (i.e. every signature protocol in existence before XML Signature came in). 4. An even better approach of course, would have been to say no to fine-grained cryptographic agility[1]. That was a terrible mistake, but it was the default design choice back in 2002, and it's hard to single out OASIS. The JOSE/JWT authors should have known better though. You could have define a couple of ciphersuites/version, and a simple, fixed signature protocol for each version. 5. The best approach would have been to just avoid signatures completely and require TLS, but this wasn't viable back in 2002. Even OAuth 1.0 and OpenID 1.0,  which came out several years later, included their own cryptographic signatures, but their schemes were still far simpler than SAML. I think the key takeaway today is that SAML is no longer necessary today. TLS is not an option for secure web resources. There are no features of SAML that cannot be supported by OAuth or OIDC (only security misfeatures). All IdPs and most products support OIDC. In fact, OIDC is probably more well-supported than SAML. SAML is only used because of enterprise inertia and self-inflicted FUD. As a professional, we should treat SAML with the the same disdain we've directed we've directed towards Internet Explorer 6. This is an insecure legacy technology that presents a drag on the entire industry. --- [1] https://www.blockchaincommons.com/musings/musings-agility/
> — [unscaled on hackernews · 1 comments](https://news.ycombinator.com/item?id=49816358)

> The root problem with SAML is there’s a million and one permutations to do the same thing. Signed assertions. Signed messages. Encrypted messages. Encrypted assertions. Sign after normalization. Sign before normalization. Encrypt then sign. Sign then encrypt. There’s too many ways to do too many things.
> — [koolba on hackernews · 1 comments](https://news.ycombinator.com/item?id=49809200)

> Does Tailscale support SAML? If not: why would any other enterprise product need to? Tailscale is like the sine qua non of modern enterprise products, and I believe it's OIDC-only. I don't believe it's plausible for any non-specialist firm to implement SAML without grave vulnerabilities. I'm not sure I've ever seen it done well. It's been a minute since I've looked (I haven't consulted in several years, but, more importantly: most firms avoid SAML now), but I'm guessing that assertion still holds.
> — [tptacek on hackernews · 4 comments](https://news.ycombinator.com/item?id=49809645)

**Source threads**

- [lobsters](https://lobste.rs/s/4uqtta/saml_fractal_bad_design) · 1 points · 0 comments
- [hackernews](https://news.ycombinator.com/item?id=49806335) · 332 points · 354 comments
- [hackernews](https://news.ycombinator.com/item?id=49788350) · 2 points · 2 comments

## Similar posts on daily.dev

- [Demystifying SAML: The Basics of Secure Single Sign-On](https://daily.dev/posts/demystifying-saml-the-basics-of-secure-single-sign-on-xgbhef7oi) · Security Boulevard · 0 upvotes · 0 comments
- [SAML authentication broken almost beyond repair](https://daily.dev/posts/saml-authentication-broken-almost-beyond-repair-yfzueeos7) · CSO Online · 0 upvotes · 0 comments
- [Is SSO the Same as SAML?](https://daily.dev/posts/is-sso-the-same-as-saml--u7l5g7ncn) · Security Boulevard · 0 upvotes · 0 comments
- [SAML vs OIDC: Choosing the Right Protocol for Modern Single Sign-On](https://daily.dev/posts/saml-vs-oidc-choosing-the-right-protocol-for-modern-single-sign-on-azkiq80zg) · Security Boulevard · 1 upvotes · 0 comments
- [Is Your SSO Protected Against Modern Credential Attacks?](https://daily.dev/posts/is-your-sso-protected-against-modern-credential-attacks--yuhxr3r0k) · BleepingComputer · 0 upvotes · 0 comments

---

Tags: [#authentication](https://daily.dev/tags/authentication)

[View this post on daily.dev](https://daily.dev/posts/saml-a-fractal-of-bad-design-6cl53ggxw)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"SAML: A fractal of bad design","url":"https://daily.dev/posts/saml-a-fractal-of-bad-design-6cl53ggxw","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/saml-a-fractal-of-bad-design-6cl53ggxw"},"datePublished":"2026-09-23T20:20:51.646Z","dateModified":"2026-09-23T20:21:31.252Z","description":"SAML, the XML-based authentication protocol behind the SSO industry, is argued to be fundamentally broken due to its reliance on XML's complexity,...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/210515debaf297332066ca8b8813a64b?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/210515debaf297332066ca8b8813a64b?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Lobsters","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Lobsters","logo":"https://media.daily.dev/image/upload/s--tl8v_Fku--/f_auto,t_logo/v1698841318/logos/lobste.jpg","url":"https://daily.dev/sources/lobsters"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/saml-a-fractal-of-bad-design-6cl53ggxw","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"authentication","timeRequired":"PT13M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Lobsters","item":"https://daily.dev/sources/lobsters"},{"@type":"ListItem","position":3,"name":"SAML: A fractal of bad design"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/saml-a-fractal-of-bad-design-6cl53ggxw#faq","mainEntity":[{"@type":"Question","name":"Why is SAML considered less secure than OpenID Connect for single sign-on?","acceptedAnswer":{"@type":"Answer","text":"SAML's security problems stem from its foundation on XML, which requires canonicalization (C14N) to produce consistent byte representations for signature validation, and uses enveloped signatures where the signature is embedded inside the data it signs. These factors repeatedly enable XML signature wrapping and parser differential attacks, such as the 2018 XML comment bypass and 2025 bypasses affecting GitHub Enterprise, whereas OIDC's JSON-based JWTs use simpler detached signatures. daily.dev surfaces security research like this for teams deciding whether to keep supporting SAML."}},{"@type":"Question","name":"What are XML signature wrapping (XSW) attacks in SAML authentication?","acceptedAnswer":{"@type":"Answer","text":"XML signature wrapping attacks exploit the difficulty of achieving byte-for-byte canonical consistency in XML, letting attackers insert forged elements that pass signature validation while altering the assertion's meaning. First systematically documented in the 2012 paper 'On Breaking SAML: Be Whoever You Want to Be,' the bug class remains present today, with new bypasses published as recently as 2025 targeting libxml2 and other parsers. engineers auditing SSO implementations follow ongoing SAML vulnerability research on daily.dev."}},{"@type":"Question","name":"Should a new SSO integration use SAML or OpenID Connect?","acceptedAnswer":{"@type":"Answer","text":"New SSO integrations should use OpenID Connect rather than SAML. OIDC avoids XML's complexity and canonicalization bugs by using JSON with detached JWT signatures, evolved organically through many targeted RFCs (like PKCE and DPoP) rather than being designed up front, and companies such as Fly.io and Tailscale already support only OIDC while refusing SAML integrations. teams weighing SSO protocol choices track OIDC versus SAML guidance on daily.dev."}}]}
```

