exploiting-saml-authentication-flaws

Tests SAML SSO implementations for signature wrapping, comment injection, and assertion replay flaws.

954|172|Updated Mar 13, 2026
One-click install
npx skills add https://github.com/xalgord/xalgorix --skill exploiting-saml-authentication-flaws
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: exploiting-saml-authentication-flaws
Source: https://github.com/xalgord/xalgorix/tree/main/internal/tools/skills/data/web-application-security/exploiting-saml-authentication-flaws
Command: npx skills add https://github.com/xalgord/xalgorix --skill exploiting-saml-authentication-flaws

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

SAML-based single sign-on often fails when a Service Provider verifies a signature over one element but trusts a different one, or skips verification entirely. This Skill provides a systematic methodology to identify and exploit these weaknesses during authorized penetration tests, proving whether an attacker can forge assertions and impersonate users.

Core Features & Use Cases

  • Signature Verification Testing: Detect missing/stripped signature acceptance, partial signing, and signature algorithm downgrade issues.
  • XML Signature Wrapping (XSW1-8): Cycle through all eight wrapping permutations with SAML Raider to inject forged assertions while the signed original passes verification.
  • NameID Comment Injection: Exploit canonicalization versus parser mismatches using XML comments and CDATA splits to truncate identities to admin accounts.
  • Use Case: During an authorized engagement against an enterprise SP, capture a valid SAMLResponse, apply the XSW3 template in SAML Raider with an admin NameID, and confirm the SP grants an admin session despite valid signature verification.

Quick Start

Capture a valid SAMLResponse from the target SSO login flow and use this Skill to test whether removing the signature or applying XSW wrapping lets you log in as a different user.

Frequently Asked Questions about exploiting-saml-authentication-flaws

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test SAML SSO for authentication bypass?

Capture a valid SAMLResponse, then systematically test signature removal, XML Signature Wrapping (XSW1-8), NameID comment injection, and assertion replay. SAML Raider in Burp Suite automates signature removal, wrapping templates, and re-signing with custom certificates.

What is XML Signature Wrapping in SAML attacks?

XML Signature Wrapping keeps a validly signed element so verification passes while injecting a second forged assertion that the application actually processes. There are eight XSW permutations differing in parent nodes, ID handling, and element ordering.

How does SAML NameID comment injection work?

Inserting an XML comment inside the NameID element keeps the signature valid because canonicalization ignores comments, but a vulnerable XML reader may return only the text before the comment. For example, [email protected]<!---->.evil.example can truncate to the admin identity.

What tools are needed for SAML penetration testing?

Burp Suite Professional with the SAML Raider extension is the primary toolkit for editing, wrapping, and re-signing SAML messages. xmllint, Python with zlib and base64, SAML-tracer, and xmlsec1 support decoding, encoding, and signature inspection.

Why does my tampered SAML message get rejected during testing?

Rejections often come from incorrect re-encoding rather than fixed vulnerabilities. Redirect-binding messages require raw-deflate, base64, and URL-encoding in the correct order, so verify your tampered message round-trips before concluding the flaw is fixed.

When should SAML flaw testing not be performed?

Only test with written authorization covering authentication bypass and IdP/SP testing. Without an explicit penetration testing agreement or bug bounty scope, forging assertions and impersonating users is unauthorized access.