Zum Inhalt springen
Skillpedia
Sicherheit6.5k · #14078

saml

Was er macht

Diese Fähigkeit erklärt Angriffe auf SAML-Single-Sign-on, einschließlich XML-Signature-Wrapping. Sie richtet sich an Sicherheitsprüfer, die Anmeldungen in Unternehmen prüfen.

Wann du ihn nutzt

  • ✓Wenn eine Website SAML-Single-Sign-on für Firmenanmeldungen nutzt und du sie testen willst.
  • ✓Wenn eine SAML-Antwort oder Metadatendatei zur Prüfung vorliegt.
  • ✓Wenn eine Sicherheitsprüfung fragt, ob Signaturen von Anmeldeaussagen richtig geprüft werden.

Link zum Skill

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/saml/SKILL.md

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/saml/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Kannst du prüfen, ob die SAML-Anmeldung unseres Unternehmens eine veränderte Anmeldenachricht annimmt?”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Dein Agent dekodiert die SAML-Nachricht und testet dann, wie der Server Signaturen und doppelte Aussagen behandelt, um zu sehen, ob er dem falschen Teil der Nachricht vertraut.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von 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 decode
  • samlxss — quick XSS payload tester in SAML attributes
  • Python saml2 — manual crafting via lxml

11. PoC pattern

  1. Capture victim's SAMLResponse in Burp
  2. Decode, identify Subject + AttributeStatement
  3. Launch SAML Raider → "XSW Test" → cycle through all 8 variants, observe response
  4. Any variant that returns logged-in-as-target = bug
  5. If XSW fails, try comment injection: inject <!-- foo --> in claim values
  6. If still fails, try signature stripping (delete <ds:Signature>)
  7. 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
Häufige Fragen

Was ist XML-Signature-Wrapping?

Ein Trick, bei dem ein gültig signierter Teil der Nachricht gültig bleibt, während die App stattdessen einen gefälschten Teil liest.

Welches Werkzeug nennt sie?

Sie nennt SAML Raider, ein Werkzeug, das die gängigen Wrapping-Varianten umsetzt.

Deckt sie das Entfernen der Signatur ab?

Ja. Sie behandelt das Entfernen der Signatur und das Fälschen von Aussagen als Angriffsarten.

Details

Originalbeschreibung des Autors

SAML 2.0 attacks — XSW (XML Signature Wrapping) variants 1-8, comment injection, signature stripping, assertion forgery, IdP metadata abuse.

repo: BitterSecurity/Decepticon

Beliebtheit

GitHub-Sterne
6.5k
Platz im Ranking
#14078
Lizenz
Apache-2.0
Aktualisiert
1.11.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills