My first two valid and rewarded Web Cache Deceptions, earning $2250
The web application cached authenticated user pages when a non-existent file extension was appended to the URL, allowing an attacker with an account to retrieve the victim's personal information such as email, name, and CSRF token. In a second instance, the attacker could obtain the victim's email, phone number, address, and PHPSESSID cookie, but not achieve account takeover due to an additional authentication cookie.
In this case, I managed to cache the victim’s email, full name, role, and other info like a CSRF token. Obviously, one of the requirements for it to work was that the victim was already logged into the application, and the other requirement was that the attacker also had an account on the platform, otherwise accessing…
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.
Context
This write-up covers two web cache deception (WCD) findings on two different applications, both reported in May 2023 and both rewarded. The first exposed a logged-in user's email, full name, role and other information such as a CSRF token through the cache. The second exposed a user's email, phone number, full name, address and the PHPSESSID cookie. Neither application is named in the report; the hosts appear as redacted and redacted2.
Web cache deception abuses the gap between what a cache thinks a URL is and what the origin server thinks it is. The cache decides whether to store a response based on the URL's extension or path, while the application routes the same URL to a dynamic, authenticated page. When the two disagree, a private page ends up stored in a shared cache and can be retrieved by someone else.
The researcher's starting point was reading material on cache vulnerabilities: @bxmbon's write-ups, which also covered web cache poisoning, and Omer Gil's white paper on web cache deception.
Setup
Two preconditions applied to the first finding:
- The victim had to be logged into the application.
- The attacker also had to have an account on the platform. Without an account, retrieving the data cached by the victim was not possible.
The researcher used Burp to inspect responses, which turned out to be essential because the browser hid the cached response behind a redirect.
Finding it
The first target's crafted URL used a path such as /account/. Appending a static-looking extension to a dynamic account URL still returned the account page, and the cache stored it. Many extensions worked for caching: avif, js, css, ico and others.
The second target was a PHP application with a page at bussines.php. Appending a path segment ending in .js to that script still loaded the victim's personal page, and the cache stored the result. In a browser the cached copy was not visible because the application redirected to the login page, but the response before the redirect, seen in Burp, contained the cached data.
Exploitation
First finding: caching the account page
-
The victim logs in.
-
The attacker sends the URL to the victim:
-
The victim clicks the link. The account page is served and the cache stores it under the
.avifURL. -
The attacker logs into their own account, goes to the same URL, and receives a 404 error. However, the victim's email, user ID and CSRF token can be read in the code of that response.
The extension appears to be what makes the cache treat the URL as a static asset, while the origin still renders the authenticated account page. The attacker receives a 404 error, yet the victim's email, user ID and CSRF token can be read in the code.
Timeline:
| Date | Event |
|---|---|
| May 9, 2023 | Reported |
| May 22, 2023 | Severity changed to P2 |
| May 22, 2023 | Triaged |
| May 24, 2023 | Rewarded $1,750 |
Second finding: caching the personal page and session cookie
- The attacker sends the following link to the victim:
https://www.redacted2.com/bussines.php/non-existent.js
- The victim opens the link, and the page loads normally. The web cache mechanism then saves this page.
- The attacker opens the same link, and the victim's personal page with all their private content is loaded.
The link appends non-existent.js to bussines.php; the victim's personal page, including email, phone number, full name, address and the PHPSESSID cookie, was cached.
When the researcher tried to view the cached data in the browser, it immediately redirected to the login page, so it looked as though WCD was not working. Inspecting the response before the redirect in Burp showed that the data was cached. In Burp, the response before the redirect showed that the data was cached.
The PHPSESSID alone was not enough for account takeover because the application used an additional cookie to authenticate the session, and that cookie was not obtained.
Timeline:
| Date | Event |
|---|---|
| May 1, 2023 | Reported |
| May 23, 2023 | Severity changed to P2 |
| May 23, 2023 | Triaged |
| June 5, 2023 | Rewarded $500 |
Root cause
The applications served authenticated, dynamic content for URLs that ended in static file extensions. The cache classified those URLs as cacheable static assets and stored the responses, while the origin continued to treat them as requests for the account or personal page. The mismatch between the cache's rule and the application's routing is the flaw.
In the first case the attacker needed an account of their own to reach the cached entry. In the second case the cached response was reachable by opening the link, but the application's redirect to the login page masked it in the browser.
Impact
In the first finding, an attacker with an account on the platform could read a victim's email, full name, role, user ID and CSRF token, provided the victim was logged in and clicked the crafted link. The cached data included a CSRF token.
In the second finding, an attacker could read a victim's email, phone number, full name, address and PHPSESSID cookie by getting the victim to open the link. Account takeover was not achieved because a second authentication cookie was required and was not exposed.
Fix
The report does not describe the fixes applied by either program. The general remediation is to make the cache and the origin agree on which URLs are static: configure the cache to store only responses that the origin explicitly marks as cacheable, and make the application reject or normalise paths that append static extensions to dynamic endpoints.
Variants to test
- Append static extensions (
avif,js,css,ico) to authenticated account URLs and check whether the response is stored and later served to another account. A positive result is a 404 or similar response whose body contains another user's data. - Append a non-existent path ending in
.jsto a PHP script that renders a personal page. A positive result is the victim's personal data returned to a different client. - When a browser redirects to a login page, inspect the response before the redirect in Burp. A positive result is cached private content in that earlier response.
- Try accessing cached data from another network. Some programs require this for the proof of concept; others accept a same-network demonstration when the application is used in a public space.
- Remember that a 404 error can also cache sensitive information, so do not discard a response just because its status looks like a failure.
What happened, in plain words
This is the story of two bugs found in May 2023, on two different websites. Both bugs belong to the same family, called web cache deception. In both cases, an attacker could trick a website into saving a private page belonging to a logged-in user, and then read that saved copy. The first bug paid $1,750 and the second paid $500, for a total of $2,250. The report does not name either website; they appear as redacted and redacted2.
To follow the story you only need a browser and a bit of patience. Everything else is explained as it comes up.
The three ideas you need first
A cookie. When you log in to a website, the site sends your browser a small piece of text called a cookie. Your browser stores it and sends it back with every request you make to that site. The cookie is how the site recognises you on the next page: "ah, this is the person who logged in a minute ago". Without it, every page would treat you as a stranger. Cookies are like the wristband you get at a festival: you show it at the gate and you are let back in without buying a new ticket.
A CSRF token. Some sites add a second, secret value to their pages, called a CSRF token. It is a random string that the site puts inside forms so it can check that a request really came from its own pages and not from a malicious site trying to act on your behalf. If an attacker learns your CSRF token, they can build requests that the site will accept as coming from you. Think of it as a numbered cloakroom ticket that matches the coat: whoever holds the ticket can collect the coat.
A web cache. Websites are expensive to build fresh for every visitor, so many of them put a cache in front of the application. A cache is a storage layer that keeps a copy of a response and hands the same copy to the next visitor, instead of asking the application to build it again. It is like a photocopier by the door: the first person asks for a document, the machine makes a copy and files it, and the next person asking for the same document gets the filed copy instantly. That is great for a public page such as a logo or a news article. It is a disaster for a private page such as your account settings, because the next person asking for it gets your copy.
What web cache deception is
The cache and the application look at the same web address (URL) and reach different conclusions about it.
- The cache decides whether to keep a copy by looking at the shape of the URL, especially its ending. A URL ending in
.js,.css,.icoor.aviflooks like a static file: an image, a stylesheet, a script. Static files are the same for everyone, so the cache happily stores them. - The application ignores that ending and routes the URL to a real, personalised page, the one that belongs to whoever is logged in.
When the two disagree, a private page gets stored in a shared cache under a URL that looks like a harmless static file. Anyone who then requests that URL receives the stored private page. That is web cache deception: the cache is deceived about what the URL is.
Where the researcher started
The researcher became interested in April in how cache vulnerabilities work, both web cache deception and its sibling web cache poisoning (where an attacker plants bad content into the cache so other visitors receive it). The starting material was @bxmbon's write-ups, which also covered poisoning, and Omer Gil's white paper on web cache deception.

The first bug: caching an account page
What the site did
The first target's crafted URL used a path such as /account/. If you added a static-looking extension to the end of an account URL, the site still returned the account page, and the cache stored it. Many extensions worked for caching: avif, js, css, ico and others.
Two conditions had to be true
- The victim had to be logged in. If the victim was not logged in, there was no private account page to save.
- The attacker also had to have an account on the platform. Without an account, retrieving the data the victim had cached was not possible.
That second condition is unusual and worth pausing on. Normally a cache serves anyone. Here, reaching the stored copy required being logged in yourself.
The steps, one by one
- The victim logs in. Their browser now holds the cookie that identifies them, so the site will show their account page.
- The attacker sends the victim this URL:
Read it piece by piece. https://redacted/ is the site (the real name is hidden). /account/ is the part of the site that shows account information. something.avif is a made-up file name ending in .avif, which is an image format. The attacker chose that ending on purpose: many extensions worked for caching, including avif.
- The victim clicks the link. Because the victim's browser sends the victim's cookie, the site builds the victim's own account page and sends it back. The cache sees a URL ending in
.avif, decides it is a static file, and keeps a copy. The private page is now sitting in shared storage. - The attacker logs into their own account, goes to the same URL, and receives a 404 error. A 404 is the "page not found" message. However, the victim's email, user ID and CSRF token can be read in the code of that response.
The attacker gets a 404 error, yet the victim's email, user ID and CSRF token can be read in the code of that response.
What was exposed and why it matters
The cached page contained the victim's email, full name, role, user ID and a CSRF token. The cached page also contained a CSRF token.
Timeline
| Date | Event |
|---|---|
| May 9, 2023 | Reported |
| May 22, 2023 | Severity changed to P2 |
| May 22, 2023 | Triaged |
| May 24, 2023 | Rewarded $1,750 |
"Triaged" means the programme's security team reviewed the report and accepted it as a real issue. P2 is a severity rating on the programme's scale.
The second bug: caching a personal page and a session cookie
What the site did
The second target's link appended non-existent.js to bussines.php, and the cache stored the victim's personal page.
The steps, one by one
- The attacker sends the victim this link:
https://www.redacted2.com/bussines.php/non-existent.js
Again, read it in pieces. https://www.redacted2.com/ is the site. bussines.php is a script that builds a personal page. /non-existent.js is a path that does not exist, ending in .js, the extension for JavaScript files. The URL ends in .js, and the victim's personal page was still loaded and cached.
-
The victim opens the link, and the page loads normally. The web cache mechanism then saves this page. The victim sees nothing unusual: their own page, as always.
-
The attacker opens the same link, and the victim's personal page with all their private content is loaded. The cache hands over the stored copy instead of asking the application to build a fresh one.
What was exposed
The cached page contained the victim's email, phone number, full name, address and the PHPSESSID cookie. PHPSESSID is the standard name PHP gives to the cookie that identifies a logged-in session. If an attacker holds it, they can often pretend to be the victim.
Here, that was not enough for an account takeover. The application used an additional cookie to authenticate the session, and the attacker could not obtain that second cookie. Account takeover means logging in as the victim and controlling their account; it did not happen here.
The redirect that hid the bug
When the researcher tried to view the cached data in the browser, it immediately redirected to the login page. It looked as though web cache deception was not working. But if you looked at the response before the redirect in Burp, the data was cached.
Burp is a tool that sits between your browser and the website and lets you read every request and response in full. A browser follows redirects automatically and shows you only the final page, so the interesting response is hidden. In Burp, the response before the redirect showed that the data was cached. The lesson is to look at the raw exchange, not at what the browser chooses to display.
Timeline
| Date | Event |
|---|---|
| May 1, 2023 | Reported |
| May 23, 2023 | Severity changed to P2 |
| May 23, 2023 | Triaged |
| June 5, 2023 | Rewarded $500 |
Why this happens at all
The applications served private, personalised pages for URLs that ended in static file extensions. The cache classified those URLs as static assets and stored the responses, while the application kept treating them as requests for the account or personal page. That disagreement between the cache's rule and the application's routing is the flaw.
In the first case, the attacker needed an account of their own to access the cached data. In the second case, the stored copy was reachable by opening the link, but the application's redirect to the login page hid it in the browser.
What the impact was
In the first finding, an attacker with an account on the platform could read a victim's email, full name, role, user ID and CSRF token, provided the victim was logged in and clicked the crafted link. The cached data included a CSRF token.
In the second finding, an attacker could read a victim's email, phone number, full name, address and PHPSESSID cookie by getting the victim to open the link. Account takeover was not achieved because a second authentication cookie was required and was not exposed.
How to fix it
The report does not describe the fixes applied by either programme. The general remedy is to make the cache and the application agree on which URLs are static: configure the cache to store only responses that the application explicitly marks as cacheable, and make the application reject or normalise paths that append static extensions to dynamic endpoints.
Things worth trying yourself
- Append static extensions (
avif,js,css,ico) to logged-in account URLs and check whether the response is stored and later served to another account. A positive result is a 404 or similar response whose body contains another user's data. - Append a non-existent path ending in
.jsto a PHP script that renders a personal page. A positive result is the victim's personal data returned to a different client. - When a browser redirects to a login page, inspect the response before the redirect in Burp. A positive result is cached private content in that earlier response.
- Try accessing cached data from another network. Some programmes require this for the proof of concept; others accept a same-network demonstration when the application is used in a public space.
- Remember that a 404 error can also cache sensitive information, so do not discard a response just because its status looks like a failure.
Glossary
- Web cache: a storage layer in front of a website that keeps copies of responses and serves them to later visitors instead of rebuilding the page each time.
- Web cache deception (WCD): a bug where a cache is tricked into storing a private page under a URL that looks like a static file, so another person can retrieve it.
- Web cache poisoning: a related bug where an attacker plants bad content into the cache so that other visitors receive it.
- Cache: short for web cache.
- URL: the address of a page or file on the web, such as
https://example.com/account/. - Extension: the ending of a file name, such as
.js,.css,.icoor.avif, which hints at the type of file. - Static file: a file that is the same for every visitor, such as an image, stylesheet or script, and is therefore safe to store in a cache.
- Dynamic page: a page built fresh for each visitor, often containing that person's private data, and therefore not safe to share through a cache.
- Cookie: a small piece of text a site gives your browser so it can recognise you on later requests.
- Session: the period during which a site remembers you as logged in, usually tracked by a cookie.
PHPSESSID: the standard name PHP gives to the cookie that identifies a logged-in session.- CSRF token: a secret random value placed in a site's pages so the site can check that a request came from its own pages and not from an attacker.
- CSRF (Cross-Site Request Forgery): an attack where a malicious site makes your browser send a request to another site while you are logged in there.
- Account takeover: an attack where someone gains control of another person's account.
- 404: the HTTP status code meaning "page not found".
- HTTP status code: a number a server sends with every response to say how the request went, such as 200 for success or 404 for not found.
- Response: what a server sends back to a browser after a request, including a status code and a body.
- Body: the content part of a response, the part a browser renders.
- Redirect: an instruction from a server telling the browser to go to a different page instead.
- Client-side effect: something that happens in the browser rather than on the server, such as following a redirect.
- Burp: a tool that sits between your browser and a website and lets you read every request and response in full.
- PHP: a programming language commonly used to build websites.
- Endpoint: a specific address on a site that performs a particular function, such as an account page or a login handler.
- Triaged: reviewed and accepted as a real issue by the programme's security team.
- P2: a severity rating on the programme's scale.
- Proof of concept (PoC): a demonstration that a bug is real, usually with steps and evidence.
- Programme: the bug bounty scheme run by an organisation that pays for reports of security issues.