Join our Newsletter — 33% off our NHI Course

What would it take for SAML authentication to resist parser mismatches?

 

(@nhi-mgmt-group)
Member Moderator
Joined: 2 years ago
Posts: 20217
Topic starter  

TL;DR: Parser mismatches in Ruby and PHP SAML libraries can still let signed responses bypass authentication through attribute pollution, namespace confusion, and void canonicalization, according to PortSwigger. SAML needs one deterministic interpretation path for both signature verification and claim extraction, or valid XML can still produce the wrong identity.

Editorial analysis by NHI Mgmt Group, based on content published by PortSwigger: “The Fragile Lock: Novel Bypasses For SAML Authentication”.

Key questions

Q: Why can a valid SAML signature still result in authentication bypass?

A: Because the signature may cover a legitimate node while the application reads attacker-controlled identity data from a different node in the same document.

Q: What signs suggest a SAML implementation is vulnerable to parser inconsistency attacks?

A: Look for separate libraries or code paths handling signature verification and assertion extraction, especially if they use different XML parsers.

Q: What breaks when SAML signature validation and assertion parsing use different XML libraries?

A: The verifier can confirm a signature on one XML object while the application consumes identity claims from another.

Practitioner guidance

  • Enforce a single XML trust boundary Make the same parser, namespace rules, and canonicalization logic responsible for both signature validation and assertion consumption so the application cannot read a different document than the verifier approved.
  • Reject ambiguous SAML attributes Treat duplicate, shadowed, or namespace-colliding attributes such as ID and samlp:ID as invalid input instead of letting library defaults decide which value wins.
  • Remove permissive extension points from SAML responses Tighten schema handling so unexpected extension elements cannot be used as insertion points for wrapped assertions or alternate signature material.

Bottom line: SAML authentication can fail even when the XML signature verifies, because parser inconsistencies let different components consume different parts of the same response.

Glossary terms: Xml signature wrapping, Canonicalisation, Attribute Pollution, Federation Trust Boundary

Explore further

View Full Forum →  |  NHI Foundation Course →  |  Our Services →  |  Read the full analysis →


This topic was modified 11 hours ago by NHI Mgmt Group

   
Quote
(@mr-nhi)
Member Moderator
Joined: 6 months ago
Posts: 20707
 

Parser agreement, not XML signatures alone, is the real control boundary in SAML. This article shows that a signed document can still be unsafe when verification and assertion parsing are performed by different components. The security decision is only as strong as the shared interpretation of namespaces, attributes, and canonicalization. The implication is that federation programmes should treat parser consistency as an identity control, not just an implementation detail.

A question worth separating out:

Q: How should teams respond when a SAML parser inconsistency is discovered?

A: Treat it as an authentication-control defect, not a minor library bug. Replace any trust-on-parse behaviour with a single authoritative interpretation path, tighten schema and extension handling, and retest every federation flow that depends on signed XML. If the application cannot prove it is consuming exactly what it verified, the control is still unsafe.

👉 Read our full editorial: SAML parser inconsistencies can still bypass authentication controls


This post was modified 11 hours ago by NHI Mgmt Group

   
ReplyQuote
Share:

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.