saml
What it does
This skill explains attacks on SAML single sign-on, including XML signature wrapping. It is for security testers reviewing enterprise login setups.
When to use it
- βWhen a site uses SAML single sign-on for company logins and you want to test it.
- βWhen a SAML response or metadata file is available for review.
- βWhen a security review asks whether signatures on login assertions are checked correctly.
Skill link
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/saml/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βCan you check whether our company SAML login accepts a changed login message?β
5 new skills a week. 1 minute to read.
How it works
The agent decodes the SAML message, then tests how the server handles signatures and duplicate assertions to see whether it trusts the wrong part of the message.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
SAML Attack Playbook
SAML is XML-based SSO used heavily in enterprise. Signatures protect assertions but XML's structural flexibility creates many opportunities to confuse signature validators.
1. Capture the flow
# Identify SAML in recon β look for:
# - /SAML/login, /sso/saml, /saml2/login
# - Form param "SAMLRequest" or "SAMLResponse" (base64 + deflate)
# - SP metadata: /SAML/metadata, /sp/metadata.xml
# - IdP metadata: /idp/metadata.xml
# Decode a SAML message in Burp via the SAML Raider plugin
# Or manually
echo "$SAMLResponse_base64" | base64 -d | xmllint --format -
2. XML Signature Wrapping (XSW) attacks
The classic SAML bug class. 8 canonical variants. SAML Raider implements all of them.
XSW1: Wrap signed Assertion inside Response, add evil assertion
<Response>
<ds:Signature>...</ds:Signature> <!-- signs the inner Assertion -->
<Assertion id="evil">
<Subject>attacker</Subject>
<AttributeStatement>...</AttributeStatement>
</Assertion>
<!-- original signed assertion moved into a deeper child or as sibling of evil -->
<Assertion id="orig">
<Subject>victim</Subject>
...
</Assertion>
</Response>
Parser-checks-signature on orig (still valid). App-reads-claims from
evil (first assertion). Bypass complete.
XSW2-8
Vary which element is signed, what gets added where, what gets renamed. Run all 8 via SAML Raider's automated XSW tester.
3. Comment injection
SAML libraries that strip XML comments BEFORE signature validation but the application reads the un-stripped version (or vice versa):
<Subject>victim@target.com<!-- foo -->.evil.com</Subject>
Some parsers see victim@target.com; others see victim@target.com.evil.com.
Famous: Cisco DUO + others in 2018 (CVE-2018-0489).
4. Signature stripping
Just delete the <ds:Signature> element. Some servers fail to enforce
signature presence.
5. Self-signed assertion (when allowed by misconfig)
Some SPs accept assertions from any IdP listed in their trust store. If the trust store is overly broad, attacker stands up own IdP, generates own cert, IdP signs assertion claiming victim identity.
6. Bypass via SAMLResponse to SAMLRequest confusion
Both are base64'd + deflated XML. Some endpoints handle either. Sending an unsigned SAMLResponse when the endpoint expects a SAMLRequest may bypass auth.
7. Attribute injection via metadata
If SP fetches IdP metadata at runtime from a URL (not pinned), attacker who can poison/spoof that URL injects malicious metadata claiming attacker's IdP signs as victim's IdP.
8. Replay
Many SAML implementations don't track assertion IDs. Capture a victim's
SAML response, replay it later. Mitigation: assertions have NotOnOrAfter
- unique
ID; SPs should track recently-used IDs in a cache.
9. KeyInfo / certificate confusion
<ds:KeyInfo> can carry the cert inline. Attacker:
- Sends own cert in KeyInfo
- Signs assertion w/ corresponding private key
- Server validates against the cert in KeyInfo (instead of its trust store)
10. Tools
- SAML Raider (Burp plugin) β XSW1-8 automation, signature operations, message editing. Essential.
samltool.comβ XML pretty-print + base64 decodesamlxssβ quick XSS payload tester in SAML attributes- Python
saml2β manual crafting via lxml
11. PoC pattern
- Capture victim's SAMLResponse in Burp
- Decode, identify Subject + AttributeStatement
- Launch SAML Raider β "XSW Test" β cycle through all 8 variants, observe response
- Any variant that returns logged-in-as-target = bug
- If XSW fails, try comment injection: inject
<!-- foo -->in claim values - If still fails, try signature stripping (delete
<ds:Signature>) - Document the modified SAMLResponse + the resulting authenticated session as PoC
12. Severity calibration
| Bug | Typical |
|---|---|
| XSW variant accepted β arbitrary user impersonation | Critical 9.8 (most enterprise SSO bounty) |
| Comment injection accepted | Critical 9.8 |
| Signature stripping accepted | Critical 9.8 |
| KeyInfo cert trust | Critical 9.8 |
| Replay window > 5 min | High 7-8 |
| Self-IdP misconfig | Critical 9.8 |
13. Defender remediation
- Use a battle-tested library (PySAML2, opensaml-cpp, OneLogin's SAML libs)
- Pin trusted IdPs by cert fingerprint, not URL
- Cache assertion IDs and reject replays
- Validate signature BEFORE comment-stripping (or after, but consistently)
- Reject responses w/o `ds:Signature
FAQ
What is XML signature wrapping?
It is a trick where a validly signed part of the message stays valid while a forged part is read by the app instead.
Which tool does it mention?
It mentions SAML Raider, a tool that implements the common wrapping variants.
Does it cover signature stripping?
Yes, it covers signature stripping and assertion forgery among its attack types.
Details
Original description by the author
SAML 2.0 attacks β XSW (XML Signature Wrapping) variants 1-8, comment injection, signature stripping, assertion forgery, IdP metadata abuse.
Popularity
- GitHub stars
- 6.5k
- Ranking position
- #14078
- License
- Apache-2.0
- Updated
- 11/1/2026
Comments
- β¦
More skills from this repository
detector-overview
6.5kHelps your agent read code that a scanner flagged and decide which flagged spots are real security bugs and which are false alarms.
exploiter-overview
6.5kHelps your agent join several confirmed security weaknesses into one test chain and check how far that chain could reach.
llm-redteam-overview
6.5kHelps your agent find the right AI red-team guide for a test, covering 15 tactic groups from prompt injection to model abuse.
aatmf-t01-prompt-injection
6.5kExplains prompt injection, where hidden instructions try to override an AI system, so security testers can check for it.
Similar skills
reverse-engineer-anything
422kHelps your agent look inside shipped apps and packages to explain features, compare versions, or guide a rebuild, using the REA tool.
1password
394kHelps your agent set up the 1Password CLI, sign in, and read or inject secrets without printing their values into chat.
healthcheck
394kHelps your agent audit the computer or server that runs OpenClaw for security risks, such as SSH, firewall, updates, and backups, then suggest safe fixes.