How I Turned an “Invisible” Header into a $$$ Bug Bounty!
The backend trusted the X-Original-URL header to override the request path, while the CDN cache key ignored that header. An attacker could poison the cache for the homepage with an error or malicious page, affecting all visitors.
medium.com
Published on medium.com
Disclaimer: This content is foreducational purposes only. The author isnot responsible for any use or misuseof the information provided.
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
The cache key did not include the X-Original-URL header, while the backend used that header to determine the response, creating a mismatch.
Impact
An attacker could serve phishing pages, fake login forms, or malicious scripts to all users visiting the affected page.
What the attacker needed
Target uses CDN with cache key ignoring X-Original-URL; backend trusts X-Original-URL header
The fix
The development team disabled parsing of X-Original-URL from untrusted sources, updated the CDN cache key to include all request headers affecting the response, and added WAF rules to block suspicious usage.
How it was found
- Send a request to the homepage with an X-Original-URL header pointing to a non-existent or attacker-controlled page.
- Observe that the CDN caches the response under the homepage path.
- Request the homepage without the header and see the cached error or malicious page.
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 cache stores copies of web pages to serve them faster. If the cache and the server disagree about which page is being requested, an attacker can make the cache store the wrong content under a popular address. Then everyone who visits that address gets the attacker's content.
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.