Skip to content
Cache bugs Disclosed report Intermediate

Web cache deception attack - expose token information

A dynamic page showing a user's personal collection and token information was cached when requested with a static-looking path, allowing an unauthenticated attacker to retrieve that data. The attacker could lure a logged-in user to the crafted URL and then access the cached response themselves.

memon Follow

Originally disclosed on HackerOne

Medium 6.5 View original
  • Triaged in 19 hours
  • Fixed in 42 hours
  • Paid in 19 hours
  • Disclosed after 30 days

Hello,

I have found new Vulnerability in your website which called Web cache deception attack. It's found first time in Paypal.

###Web Cache Deception Attack Websites often tend to use web cache functionality to store files that are often retrieved, to reduce latency from the web server.

####Let's see an example of web cache. Website http://www.example.com is configured to go through a reverse proxy. A dynamic page that is stored on the server and returns personal content of users, such as http://www.example.com/home.php, will have to create it dynamically per user, since the data is different for each user. This kind of data, or at least its personalized parts, isn't cached. What's more reasonable and common to cache are static, public files: style sheets (css), scripts (js), text files (txt), images (png, bmp, gif), etc. This makes sense because these files usually don't contain any sensitive information. In addition, as can be found in various best practices articles about web cache configuration, it's recommended to cache all static files that are meant to be public, and disregard their HTTP caching headers. What happens when accessing a URL like http://www.example.com/home.php/non-existent.css A GET request to that URL will be produced by the browser. The interesting thing is the server's reaction – how does it interpret the request URL? Depending on its technology and configuration (the URL structure might need to be built slightly different for different servers), the server returns the content of http://www.example.com/home.php. And yes, the URL remains http://www.example.com/home.php/non-existent.css. The HTTP headers will be the same as for accessing http://www.example.com/home.php directly: same caching headers and same content type (text/html, in this case).

Steps To Reproduce:

  1. Login to your account.
  2. Go to https://chaturbate.com/my_collection/.
  3. Then after go to https://chaturbate.com/my_collection/min.js.
  4. Open private mode (Incognito window) or Any other browser and paste https://chaturbate.com/my_collection/min.js url in address bar. Now you can see then without authanticated i can all the detaills of user account.

#####Attached video PoC for more information.

I hope you understand.

Regards, Memon

Impact

An attacker who lures a logged-on user to access https://chaturbate.com/my_collection/min.js will caue this page – containing the user's personal content and Token information – to be cached and thus publicly-accessible. It could get even worse, if the body of the response contains (for some reason) the session identifier, security answers or CSRF tokens. All the attacker has to do now is to access this page on his own and expose this data.

Attachments

web_cache.mov From the original on HackerOne

The original report as published on HackerOne, by memon. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 4 min read.

Context

Chaturbate is a live streaming site with user accounts. The feature involved here is https://chaturbate.com/my_collection/, a per-user page that returns the logged-in user's personal content. The report describes the bug as a web cache deception attack, a class the researcher notes was first found in PayPal.

The mechanism the report explains is straightforward. Sites commonly put a cache or reverse proxy in front of the origin to store frequently retrieved files and reduce latency. Dynamic pages such as home.php are generated per user and are not cached, because their content differs per user. Static, public files are the reasonable thing to cache: style sheets (css), scripts (js), text files (txt), images (png, bmp, gif). The report adds that caching best practices recommend caching all static files meant to be public and disregarding their HTTP caching headers.

The trick is to make a dynamic page look like a static file to the cache while the origin still serves the dynamic page. The report's example is a URL like http://www.example.com/home.php/non-existent.css. The browser issues a GET request for that URL. How the server interprets it depends on its technology and configuration, and the URL structure might need to be built slightly differently for different servers. In the example, the server returns the content of http://www.example.com/home.php, while the URL in the address bar remains http://www.example.com/home.php/non-existent.css. The HTTP headers are the same as for accessing http://www.example.com/home.php directly: same caching headers and same content type, text/html in this case. The report's example stops at the server returning the dynamic page under the static-looking URL.

Setup

The report lists no tools, versions or special configuration. The preconditions are simply an account on the site and a second, unauthenticated context (a private/incognito window or another browser) to check what the cache serves to someone who is not logged in.

Finding it

The researcher applied the cache deception pattern to a page that returns personal data, https://chaturbate.com/my_collection/, and appended a static-looking path segment to it. The observation that made it a finding is that the resulting URL, requested without authentication, returned the details of a user account.

Exploitation

Step 1: log in

  1. Login to your account.

This establishes the victim-side session whose personal content will be placed in the cache.

Step 2: open the dynamic page

  1. Go to https://chaturbate.com/my_collection/.

This is the normal, per-user page. The report does not show its response.

Step 3: request the disguised URL

  1. Then after go to https://chaturbate.com/my_collection/min.js.

The path ends in .js, and the report shows that requesting it without authentication returned the user's account details. The origin, however, resolves the path to the my_collection page and returns that page's HTML, including the logged-in user's data. The report does not include the raw response or its headers.

Step 4: read it back unauthenticated

  1. Open private mode (Incognito window) or Any other browser and paste https://chaturbate.com/my_collection/min.js url in address bar. Now you can see then without authanticated i can all the detaills of user account.

With no session, the same URL returned the details of a user account. The report does not show the body of this response.

A video PoC is attached to the report.

web_cache.mov From the original on HackerOne

Root cause

The report frames the cause as the cache and the origin disagreeing about what the URL means. The report frames the cause as the cache and the origin disagreeing about what the URL means, without describing the specific configuration.

Impact

An attacker who lures a logged-on user to access https://chaturbate.com/my_collection/min.js causes that page, containing the user's personal content and token information, to be cached and thus publicly accessible. The attacker then only has to access the same URL on their own to expose the data. The report hedges that it could get worse if the body of the response contains, for some reason, the session identifier, security answers or CSRF tokens. The platform rates the issue medium severity with a CVSS score of 6.5, classified as information disclosure.

Fix

A reasonable mitigation would be to stop the cache storing responses for URLs that resolve to dynamic pages.

Variants to test

  • Append a static extension to other authenticated pages and request the result from a clean browser. A positive result is the personal page being returned without a session.
  • Try several extensions, since caches may only match a fixed list: .css, .js, .txt, .png, .bmp, .gif.
  • Try path variants such as a trailing slash plus extension, or an encoded separator, where the origin and cache parse paths differently. A positive result is the same personal content served unauthenticated.
  • Check whether the cached response includes tokens or identifiers that are usable elsewhere, such as CSRF tokens or session values. A positive result is a token from the cached page being accepted by the application.
  • Test other cache layers, such as CDNs in front of APIs, with the same extension trick on endpoints that return per-user JSON. A positive result is another user's data returned to an unauthenticated request.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 8 min read.

What happened, in plain words

Chaturbate is a live streaming site where people create accounts and log in. One of its pages, https://chaturbate.com/my_collection/, is personal: when you are logged in, it shows your own content. The researcher found that this personal page could be made to be stored by a caching system in front of the site, and then read by anyone, without logging in at all.

The trick is called a web cache deception attack. The researcher notes it was first found in PayPal. To understand it, you need to know what a cache is. A cache is a storage layer that sits between visitors and the real website. When many people ask for the same file, the cache keeps a copy and hands it out quickly instead of asking the website every time. It is like a receptionist who keeps a stack of the most requested leaflets on the desk, so they do not have to walk to the archive room for each visitor.

Caches are meant to store public, unchanging files: style sheets (.css), scripts (.js), text files (.txt), images (.png, .bmp, .gif). These files are the same for everyone, so keeping a copy is safe. Personal pages, on the other hand, are built fresh for each logged-in user, so they should never be stored and shared.

The attack makes a personal page look like a public file to the cache. You do this by adding a fake file name to the end of the personal page's address. The cache may treat the address as a public file, while the real website still returns the personal page.

The example the researcher gives

The report starts with a simple example. A website, http://www.example.com, is set up so that traffic passes through a reverse proxy. A reverse proxy is a server that sits in front of the real website and forwards requests to it, often adding caching. A dynamic page such as http://www.example.com/home.php is generated separately for each user, because the data is different for each user. That kind of page is not cached. What is reasonable to cache are static, public files: style sheets, scripts, text files and images. The report adds that caching best practices recommend caching all static files meant to be public and ignoring their HTTP caching headers.

Now consider a URL like http://www.example.com/home.php/non-existent.css. The browser sends a GET request for that URL. A GET request is simply the browser asking the server for a page or file. The interesting part is how the server interprets the address. Depending on its technology and configuration, the server returns the content of http://www.example.com/home.php, while the address bar still shows http://www.example.com/home.php/non-existent.css. The HTTP headers are the same as when you visit http://www.example.com/home.php directly: same caching headers and same content type, text/html in this case. HTTP headers are small pieces of information sent alongside a page, telling the browser and any middle servers what the content is and how it may be handled. The report's example stops at the server returning the dynamic page under the static-looking URL.

Setting up

The report lists no tools, versions or special configuration. All you need is an account on the site and a second, logged-out browser context, such as a private or incognito window, or a different browser. That second context is how you check what the cache serves to someone who is not logged in.

Finding it

The researcher took the cache deception pattern and applied it to a page that returns personal data, https://chaturbate.com/my_collection/. They added a static-looking path segment to the end of it. The finding was that the resulting URL, requested without being logged in, returned the details of a user account.

Exploitation

Step 1: log in

  1. Login to your account.

This creates the logged-in session whose personal content will end up in the cache. A session is the state of being logged in: the site remembers who you are between requests, usually by giving your browser a cookie. A cookie is a small piece of data the site stores in your browser and that your browser sends back with each request, so the site can recognise you.

Step 2: open the personal page

  1. Go to https://chaturbate.com/my_collection/.

This is the normal, per-user page. Visiting it first is how you see what the page normally contains. The report does not show its response.

Step 3: request the disguised URL

  1. Then after go to https://chaturbate.com/my_collection/min.js.

Line by line:

  • GET /my_collection/min.js HTTP/1.1 is the browser asking the server for the path /my_collection/min.js using version 1.1 of the HTTP protocol. HTTP is the language browsers and servers use to talk to each other.
  • Host: chaturbate.com tells the server which website the request is for. One server can host many sites, so this header says which one you mean.

The path ends in .js, and the report shows that requesting it without authentication returned the user's account details. The real website, however, resolves the path to the my_collection page and returns that page's HTML, including the logged-in user's data. HTML is the code that describes the structure of a web page. The report does not include the raw response or its headers.

Step 4: read it back without logging in

  1. Open private mode (Incognito window) or Any other browser and paste https://chaturbate.com/my_collection/min.js url in address bar. Now you can see then without authanticated i can all the detaills of user account.

Line by line:

  • GET /my_collection/min.js HTTP/1.1 is the same request as before, but this time it comes from a browser with no login session.
  • Host: chaturbate.com again names the website being requested.

With no session, the same URL returned the details of a user account. The report does not show the body of this response.

A video proof of concept is attached to the report.

web_cache.mov From the original on HackerOne

Why it works

The report frames the cause as the cache and the real website disagreeing about what the URL means. The report frames the cause as the cache and the real website disagreeing about what the URL means, without describing the specific configuration.

Impact

An attacker who lures a logged-on user to access https://chaturbate.com/my_collection/min.js causes that page, containing the user's personal content and token information, to be cached and thus publicly accessible. A token is a short value used to prove identity or authorise an action, similar to a temporary pass. The attacker then only has to access the same URL on their own to expose the data. The report hedges that it could get worse if the body of the response contains, for some reason, the session identifier, security answers or CSRF tokens. A CSRF token is a value embedded in a page to prove that a form submission came from that page and not from another site. The platform rates the issue medium severity with a CVSS score of 6.5, classified as information disclosure. CVSS is a standard scoring system for how serious a vulnerability is.

Fix

A reasonable mitigation would be to stop the cache storing responses for URLs that resolve to dynamic pages.

Variants to test

  • Append a static extension to other logged-in pages and request the result from a clean browser. A positive result is the personal page being returned without a session.
  • Try several extensions, since caches may only match a fixed list: .css, .js, .txt, .png, .bmp, .gif.
  • Try path variants such as a trailing slash plus extension, or an encoded separator, where the website and the cache parse paths differently. A positive result is the same personal content served without logging in.
  • Check whether the cached response includes tokens or identifiers that are usable elsewhere, such as CSRF tokens or session values. A positive result is a token from the cached page being accepted by the application.
  • Test other cache layers, such as CDNs in front of APIs, with the same extension trick on endpoints that return per-user JSON. A CDN is a network of servers spread around the world that cache and deliver content close to users. An API is a way for programs to talk to a service and exchange data, often in JSON, a text format for structured data. A positive result is another user's data returned to a request that is not logged in.

Glossary

  • Web cache deception: an attack where a personal page is made to look like a public file so a cache stores it and serves it to anyone.
  • Cache: a storage layer that keeps copies of frequently requested content to answer faster.
  • Reverse proxy: a server in front of the real website that forwards requests to it, often adding caching.
  • Dynamic page: a page built fresh for each user or request, because its content differs.
  • Static file: a file that is the same for everyone, such as a style sheet, script, text file or image.
  • GET request: the browser asking the server for a page or file.
  • HTTP: the language browsers and servers use to exchange requests and responses.
  • HTTP headers: small pieces of information sent with a request or response, describing the content and how to handle it.
  • Content type: a header value saying what kind of content is being returned, such as text/html.
  • HTML: the code that describes the structure of a web page.
  • Session: the state of being logged in, remembered by the site between requests.
  • Cookie: a small piece of data stored in your browser and sent back with requests so the site can recognise you.
  • Token: a short value used to prove identity or authorise an action.
  • CSRF token: a value embedded in a page to prove a form submission came from that page.
  • CVSS: a standard scoring system for the severity of a vulnerability.
  • CDN: a network of servers that cache and deliver content close to users.
  • API: a way for programs to talk to a service and exchange data.
  • JSON: a text format for structured data.

More by memon

View all

1 more disclosed report, best first.

More from Chaturbate

View all

The newest disclosed reports for this program.

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.