Skip to content
Cache bugs Write-up Intermediate

Leaking secrets through caching with Bunny CDN

Bunny CDN cached responses to requests with an Authorization header and served them to other users, ignoring the header. An attacker could retrieve private data or API keys belonging to other users by requesting the same URL.

Tim Perry Follow

Published on httptoolkit.com

Unfortunately though, caching is quite important. Hosted caching & CDNs offer incredible powers that can provide amazing performance boosts, cost savings & downtime protection, essential for most modern sites with any serious volume of users.

Tim Perry (@pimterry), on httptoolkit.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

The CDN cached responses to requests containing an Authorization header without including that header in the cache key, contrary to the HTTP caching standard.

Impact

Private user data and potentially API keys could be exposed to other users, and the issue could be invisible if only some API endpoints go through the cache.

What the attacker needed

CDN caches authenticated responses; Attacker knows or guesses a URL

The fix

Bunny changed the default so that requests with an Authorization header skip caching but can still use existing cached responses; this was released in late May.

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 is a network of servers that store copies of web content to speed up delivery. Normally, when a request includes a secret token (an Authorization header) to prove who you are, the CDN should not store the response and give it to someone else. Here, Bunny CDN did store such responses and then handed them to other users, so private information could leak.

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.

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.