Skillpedia
الأمان6.5k · #14073

oauth

ما الذي تفعله

تشرح هذه المهارة أخطاء OAuth وOpenID الشائعة، مثل عناوين إعادة التوجيه الفضفاضة وفحوص الحالة الضعيفة. وهي موجهة لمختبري الأمان الذين يراجعون تسجيل الدخول بحسابات طرف ثالث.

متى تستخدمها

  • ✓عندما يقدم موقع خيار تسجيل الدخول عبر مزود مثل Google أو خدمة OAuth أخرى.
  • ✓عندما تسأل مراجعة أمنية هل يتم فحص عناوين إعادة التوجيه بدقة.
  • ✓عندما تريد اختبار هل يمكن استخدام رمز تسجيل دخول مسروق في حساب آخر.

رابط المهارة

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

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/oauth/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“هل يمكنك التحقق مما إذا كان تدفق تسجيل الدخول بحساب Google في موقعي يرسل رموز الدخول إلى عنوان خاطئ؟”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

يرسم الوكيل نقاط نهاية تسجيل الدخول، ويغيّر عنوان إعادة التوجيه ومعاملات أخرى، ويتحقق مما إذا كان المزود أو الموقع يقبل القيم المعدّلة.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

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:

  1. Victim signs in to target via OAuth (Google/Microsoft)
  2. Attacker finds open-redirect or XSS on target
  3. Attacker crafts OAuth init URL w/ redirect_uri pointing to attacker via open-redirect
  4. Victim clicks → server issues code → redirected to attacker's host w/ code in URL
  5. 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
الأسئلة الشائعة

ما هو تجاوز redirect_uri؟

يحدث عندما يقبل خادم تسجيل الدخول عنوان رجوع معدّلاً قليلاً، فيُرسل رمز الدخول إلى مكان غير الموقع الحقيقي.

هل يغطي PKCE؟

نعم، يذكر التحقق مما إذا كان PKCE يمكن خفض مستواه أو تجاوزه.

من أين يبدأ؟

يبدأ بقراءة ملف openid-configuration الخاص بالمزود لإيجاد نقاط النهاية الرئيسية.

التفاصيل

الوصف الأصلي من المؤلف

OAuth 2.0 / OIDC attacks — redirect_uri bypass, state CSRF, code leak via Referer, response_type confusion, PKCE downgrade, scope creep, ATO chains.

repo: BitterSecurity/Decepticon

الشعبية

نجوم GitHub
6.5k
الترتيب
#14073
الترخيص
Apache-2.0
آخر تحديث
1‏/11‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة