saml
Skill này làm gì
Skill này giải thích các cuộc tấn công nhắm vào đăng nhập một lần SAML, gồm XML signature wrapping. Dành cho người kiểm thử bảo mật rà soát thiết lập đăng nhập của doanh nghiệp.
Khi nào nên dùng
- ✓Khi một trang dùng đăng nhập một lần SAML cho tài khoản công ty và bạn muốn kiểm thử nó.
- ✓Khi có sẵn một thông điệp SAML hoặc file metadata để rà soát.
- ✓Khi một rà soát bảo mật hỏi liệu chữ ký trên xác nhận đăng nhập có được kiểm tra đúng không.
Liên kết skill
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/saml/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Bạn có thể kiểm tra xem đăng nhập SAML của công ty chúng tôi có chấp nhận một thông điệp đăng nhập đã bị sửa không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent giải mã thông điệp SAML, rồi kiểm thử cách máy chủ xử lý chữ ký và các xác nhận trùng lặp để xem nó có tin nhầm phần của thông điệp không.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
Câu hỏi thường gặp
XML signature wrapping là gì?
Đó là thủ đoạn khiến một phần đã được ký hợp lệ vẫn giữ hiệu lực, trong khi ứng dụng lại đọc một phần giả mạo.
Skill nhắc đến công cụ nào?
Nó nhắc đến SAML Raider, một công cụ triển khai các biến thể wrapping phổ biến.
Nó có bao gồm việc gỡ chữ ký không?
Có. Nó bao gồm việc gỡ chữ ký và giả mạo xác nhận trong số các kiểu tấn công.
Chi tiết
Mô tả gốc của tác giả
SAML 2.0 attacks — XSW (XML Signature Wrapping) variants 1-8, comment injection, signature stripping, assertion forgery, IdP metadata abuse.
Độ phổ biến
- Sao GitHub
- 6.5k
- Vị trí xếp hạng
- #14078
- Giấy phép
- Apache-2.0
- Cập nhật
- 1/11/2026
Bình luận
- …
Thêm skill từ kho mã này
detector-overview
6.5kGiúp agent của bạn đọc code mà một công cụ quét đã đánh dấu, rồi quyết định điểm nào là lỗ hổng bảo mật thật và điểm nào là báo động giả.
exploiter-overview
6.5kGiúp agent của bạn ghép nhiều lỗ hổng bảo mật đã xác nhận thành một chuỗi kiểm thử và kiểm tra chuỗi đó có thể gây hậu quả đến đâu.
llm-redteam-overview
6.5kGiúp agent của bạn tìm đúng hướng dẫn red-team AI cho một bài kiểm thử, bao quát 15 nhóm chiến thuật từ prompt injection đến lạm dụng mô hình.
aatmf-t01-prompt-injection
6.5kGiải thích prompt injection, khi các chỉ dẫn ẩn cố ghi đè một hệ thống AI, để chuyên gia bảo mật có thể kiểm tra lỗi này.
Skill tương tự
reverse-engineer-anything
422kGiúp agent của bạn xem bên trong các app và package đã phát hành để giải thích tính năng, so sánh phiên bản hoặc hướng dẫn dựng lại bằng công cụ REA.
1password
394kGiúp agent của bạn cài đặt CLI của 1Password, đăng nhập, và đọc hoặc đưa thông tin bí mật vào mà không in giá trị ra cuộc trò chuyện.
healthcheck
394kGiúp agent của bạn rà soát bảo mật máy tính hoặc máy chủ đang chạy OpenClaw, như SSH, tường lửa, cập nhật và sao lưu, rồi đề xuất cách sửa an toàn.