Content Deep Dive

SAML Comment Injection: How a NameID Can Lie to Your App

Blog post from SSOJet

Post Details
Company
Date Published
Author
-
Word Count
1,849
Company Posts That Month
42
Language
English
Hacker News Points
-
Post removed?
No
Summary

SAML comment injection is an authentication-bypass vulnerability in which an attacker inserts an XML comment into a signed SAML NameID, allowing XML canonicalization to preserve signature validity while flawed service-provider code reads only the text before the comment and mistakes the attacker for another user. Duo Labs disclosed this issue in 2018, coordinating with CERT/CC on vulnerabilities affecting several libraries, including python-saml, ruby-saml, saml2-js, OmniAuth-SAML, openSAML C++, and SAMLBase. The underlying mismatch occurs because common XML canonicalization methods omit comments from signed data, whereas unsafe DOM traversal such as reading a first child node can truncate the identity value. Secure implementations should extract an element’s complete text content from the signature-verified XML tree, ignore comments, avoid reparsing raw assertions, and associate users with stable IdP-specific identifiers rather than email addresses alone. The mock-idp testing tool can generate valid signed assertions containing this fault to test service providers, with safe behavior consisting of accepting the complete signed identifier or rejecting it rather than authenticating the shortened identity.

Trends Found in this Post
Trend Post Mentions Total Month Mentions Posts Companies MoM
Platform Engineering 26 1,145 237 66 -43%
Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.