Skip to content
Cache bugs Write-up Intermediate

Cache Clash: How CDN Misconfigurations Let Me Hijack Thousands of User Sessions

The CDN cached dynamic API responses using only the URL path as the cache key, ignoring headers like Authorization and Cookie. An attacker could poison the cache with malicious JavaScript via the X-Forwarded-Host header and retrieve other users' cached private data, leading to session hijacking and data leakage.

iski Follow

Published on medium.com

Free link 🎈

Iski, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the CDN was configured to use only the URL path as the cache key, ignoring headers such as Authorization and Cookie, and the application trusted the X-Forwarded-Host header without validation.

Impact

The attacker could hijack user sessions, leak private data across all users, and distribute malware via cache poisoning, though the text does not mention any defences that limited the attack.

What the attacker needed

Access to the CDN endpoint; Ability to send custom headers

The fix

The CDN should include all relevant headers (Authorization, Cookies) in cache key generation, never cache dynamic content, and validate X-Forwarded-* headers.

How it was found

  1. Identify cacheable dynamic endpoints through the CDN.
  2. Test cache behaviour with different Authorization headers and observe X-Cache: HIT for different users.
  3. Test the X-Forwarded-Host header and observe X-Cache: MISS and that the response body includes a script tag pointing to the attacker's host.
  4. Poison the cache by sending a request with a malicious X-Forwarded-Host header and a script payload.
  5. Request the same URL without authentication to retrieve cached private data from other users.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A CDN (Content Delivery Network) is a service that stores copies of website content to serve it faster. Here, the CDN mistakenly stored private user data and served it to anyone who asked for the same web address, because it didn't check who was asking. This let an attacker see other people's account details and even inject malicious code that would run in victims' browsers.

What is Cache bugs?

A cache and the origin disagree about a request, so a poisoned response is served to everyone or a private page is stored as public.

More by iski

View all

186 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Web cache poisoning and deception

The lesson behind this report.

A cache and the origin disagree about a request, so a poisoned response is served to everyone or a private page is stored as public.