Skip to content
Misconfiguration Write-up Beginner

Hunting Unauthenticated Varnish Cache PURGE: A Bug Bounty Methodology

A Varnish cache endpoint accepted the non-standard PURGE HTTP method without any authentication. An attacker could invalidate arbitrary cache entries, potentially causing cache manipulation or denial of service.

Mephisto Follow

Published on medium.com

Bugbounty Writeup

Mephisto, 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.

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. 3 min read.

Context

Varnish Cache is an HTTP reverse proxy widely used by large sites to speed up response times by storing cached copies of content. One of its operational features is the PURGE method, used internally by teams to invalidate specific cache entries, typically after content updates.

The catch is that PURGE is not a standard HTTP method like GET, POST or PUT. Because of that, it is often missed by access control configurations, which usually only account for common methods. Developers frequently forget to restrict who is allowed to send it.

The target of this write-up is a bug bounty program whose name is intentionally withheld, as it was a private or policy-restricted program. The focus is purely on technique and methodology, not on a specific disclosure.

Setup

The report describes reconnaissance on a bug bounty target and notes that a single curl command is enough to prove the finding. No accounts, roles, software versions or other preconditions are described.

Finding it

During reconnaissance the researcher came across a configuration flaw: a caching endpoint that accepted a non-standard HTTP method with zero authentication. The first step was to confirm whether the target actually runs Varnish, by looking at the response headers.

From the original on medium.com

These headers are often dismissed by developers as just performance information, but they leak the caching architecture to anyone paying attention.

Exploitation

Step 1: Fingerprinting the cache layer

Before attempting anything, the researcher confirmed that the target runs Varnish by inspecting the headers returned by the site, as shown in the image above.

Step 2: Testing the non-standard method

Once Varnish was confirmed, the researcher tested whether the PURGE method was accepted without any credentials.

From the original on medium.com

The request used a cache-buster parameter, cb=$(date +%s). It ensures each request has a unique query string, making it easier to correlate with the response ID returned by the server and avoiding overlap with previous test requests when reviewing logs.

A 200 OK with a JSON confirmation, instead of 403 Forbidden or 405 Method Not Allowed, is a clear sign that no access control exists on this method whatsoever.

Root cause

The flaw is that the PURGE method is not a standard HTTP method, so access control configurations that only account for common methods such as GET, POST and PUT do not cover it. The endpoint accepted the method with zero authentication. The report does not describe the specific configuration that was in place, so the exact mechanism is likely a missing restriction on who is allowed to send PURGE.

Impact

The researcher describes the finding as a cache manipulation vulnerability that often slips under the radar. The report does not enumerate specific attacker outcomes beyond that, and it stresses that impact was validated proportionally and that the severity assessment was an important part of the submission process. The real value of the experience, in the author's words, was the lesson in assessing impact accurately and accepting a triage outcome professionally.

Fix

The report does not state what was changed or what remediation was applied. The implied fix is to restrict who is allowed to send the PURGE method, so that it is not accepted without credentials.

Variants to test

The report does not list additional variants. The methodology it describes can be repeated on other targets: fingerprint the cache layer from response headers, then send a PURGE request without credentials, using a unique cache-buster query string so that each request can be correlated with the response ID in the logs. A positive result is a 200 OK with a JSON confirmation rather than 403 Forbidden or 405 Method Not Allowed.

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. 9 min read.

What happened, in plain words

A security researcher was looking around a website that paid people for finding its mistakes, a setup usually called a bug bounty program. While poking at the site, the researcher found a small configuration mistake with a big consequence: one of the site's caching endpoints accepted a special request called PURGE from anyone at all, with no login and no password.

To understand why that matters, you need to know what a cache is. A cache is a shortcut. Imagine a busy restaurant kitchen that keeps a few popular dishes already plated and warm under a lamp, so waiters can grab them instantly instead of asking the kitchen to cook from scratch every time. Websites do the same thing: instead of rebuilding a page for every visitor, they keep a saved copy and hand it out. That saved copy is the cache, and the software that manages it here is called Varnish Cache.

PURGE is the instruction that tells the cache to throw away a saved copy, because the content has changed and the old copy is now wrong. Normally only the site's own staff should be able to send that instruction. Here, anyone could. The researcher describes the finding as a cache manipulation vulnerability.

The researcher's name for this write-up is Mephisto. The site's name is deliberately left out, because the program was private or policy-restricted. So everything below is about the technique, not about a named company.

The author also makes a point that is easy to skip past: finding the bug was the easy part. The harder and more valuable part was judging honestly how serious it was, and accepting the program's decision about it without arguing.

Background: what Varnish and PURGE actually are

Varnish Cache is a piece of software that sits in front of a website, between the visitor and the real server. It is called a reverse proxy. A useful comparison is a receptionist at an office: visitors do not walk straight to the employees' desks, they talk to the receptionist first, and the receptionist answers the common questions herself. Varnish does that for web pages. When someone asks for a page, Varnish checks whether it already has a saved copy. If it does, it hands that copy over immediately. If not, it asks the real server, then keeps a copy for next time.

Large sites use this because it makes pages load much faster and puts less strain on the servers behind.

One of Varnish's built-in features is the PURGE method. A method, in web terms, is the type of request being made. The everyday ones are:

  • GET: give me this page.
  • POST: here is some data, please do something with it.
  • PUT: here is some data, please store or replace it.

PURGE is not one of those standard methods. It is an extra one that Varnish understands, and it means: throw away the saved copy of this page. Site teams use it internally, typically right after they update content, so visitors stop seeing the old version.

The problem is exactly that PURGE is unusual. Access control is the set of rules that decides who is allowed to do what. Those rules are often written by listing the common methods, GET, POST, PUT, and saying what each one requires. Because PURGE is not on that familiar list, it is easy to forget to write a rule for it. Developers frequently forget to restrict who is allowed to send it, and the result is a method that nobody is guarding.

Step 1: Fingerprinting the cache layer

Before trying anything, the researcher needed to confirm that the target really does run Varnish. This is called fingerprinting: gathering small clues that reveal what software a site is built on, the way you might recognise a car's make from its shape before reading the badge.

The clue here is in the response headers. Every time your browser asks a website for a page, the server sends back the page plus a small block of extra information called headers. Headers are not shown on the page itself, but they travel with it. They can say what kind of content it is, when it was last changed, and sometimes which software produced it.

From the original on medium.com

These headers are often dismissed by developers as just performance information, meaning details about speed and caching. But they actually leak the caching architecture, the internal design of how the site's caching is set up, to anyone paying attention. That is why this step comes first: if the site did not run Varnish, sending a PURGE request would be pointless, and the researcher would move on rather than waste time.

Step 2: Testing the non-standard method

With Varnish confirmed, the next question was simple: does the site accept a PURGE request from someone with no credentials at all? Credentials means proof of who you are, such as a login, a password, or a session cookie. A cookie is a small piece of data your browser stores for a site, often used to remember that you are logged in. Sending a request without credentials is the same as walking up to a locked door and simply trying the handle.

From the original on medium.com

The request used a cache-buster parameter, cb=$(date +%s). A parameter is an extra piece of information attached to a web address, usually after a question mark, that the server can read. A cache-buster is a value that is different every time, added so that the request cannot be confused with an earlier one.

The reason for it is practical. It ensures each request has a unique query string, the part of the address carrying those parameters. That makes it easier to correlate the request with the response ID returned by the server, meaning to match up which request produced which answer when reviewing logs. Logs are the records a server keeps of what it was asked and what it replied. It also avoids overlap with previous test requests, so the researcher does not mistake an old entry for a new one.

The result was a 200 OK with a JSON confirmation. 200 OK is the standard code a server sends when a request succeeded. JSON is a common, simple text format for structured data, the kind of thing that looks like labelled values in curly brackets. What mattered was what did not come back: not 403 Forbidden, which means you are not allowed to do this, and not 405 Method Not Allowed, which means this type of request is not accepted here at all.

Getting a success code with a confirmation instead of one of those two refusals is a clear sign that no access control exists on this method whatsoever. In plain terms: the door was not just unlocked, there was no lock on it.

Why this happens

The root cause is the mismatch described earlier. PURGE is not a standard HTTP method, so access control configurations that only account for common methods such as GET, POST and PUT simply do not cover it. The endpoint accepted the method with zero authentication. Authentication is the process of checking who someone is; zero authentication means nobody checked at all.

The report does not describe the specific configuration that was in place, so the exact mechanism is likely a missing restriction on who is allowed to send PURGE. In other words, the rule that should have said only staff may purge was never written.

What the impact was, and what it was not

The researcher describes the finding as a cache manipulation vulnerability that often slips under the radar. Cache manipulation means being able to change or remove what the cache serves, rather than the content on the real server.

The report does not enumerate specific attacker outcomes beyond that. It stresses that impact was validated proportionally, meaning the researcher tried to judge how bad it really was rather than inflating it, and that the severity assessment was an important part of the submission process. Severity is the rating of how serious a bug is, which usually decides whether and how much a program pays.

The author's own conclusion is worth repeating because it is the point of the piece: the real value of the experience was not the technical finding. It was the lesson in assessing impact accurately and accepting a triage outcome professionally. Triage is the stage where the program reviews a report and decides what to do with it.

How it should be fixed

The report does not state what was changed or what remediation was applied. The implied fix is to restrict who is allowed to send the PURGE method, so that it is not accepted without credentials. In everyday terms: put the lock back on the door, and make sure the list of locked doors includes the unusual one.

Repeating the technique elsewhere

The report does not list additional variants. The methodology it describes can be repeated on other targets, and it is short enough to remember as a routine:

  1. Fingerprint the cache layer from the response headers, to confirm the site uses Varnish.
  2. Send a PURGE request without credentials, using a unique cache-buster query string so that each request can be correlated with the response ID in the logs.
  3. Treat a 200 OK with a JSON confirmation as a positive result, rather than 403 Forbidden or 405 Method Not Allowed.

The whole thing is technically simple. As the author puts it, a single curl command is enough to prove it. curl is a small command-line tool for sending web requests by hand, without a browser, which makes it easy to send unusual requests that a browser would never send on its own.

Glossary

  • Access control: the rules that decide who is allowed to do what on a system.
  • Authentication: the process of checking who someone is, for example by a login.
  • Bug bounty program: a scheme where an organisation pays people for reporting security mistakes in its systems.
  • Cache: a saved copy of content kept close at hand so it can be served quickly instead of being rebuilt each time.
  • Cache-buster: a value added to a request that is different every time, so the request cannot be confused with an earlier one.
  • Cache manipulation: being able to change or remove what a cache serves.
  • Cookie: a small piece of data a browser stores for a site, often used to remember that you are logged in.
  • Credentials: proof of identity, such as a login, password or session cookie.
  • curl: a command-line tool for sending web requests by hand.
  • Endpoint: a specific address on a server that accepts requests and does something with them.
  • Fingerprinting: gathering clues that reveal what software or setup a site uses.
  • GET / POST / PUT: the standard types of web request, roughly meaning fetch, submit, and store or replace.
  • Headers: extra information sent alongside a web page, not shown on the page itself.
  • HTTP method: the type of a web request, such as GET or POST.
  • JSON: a simple text format for structured data.
  • Logs: records a server keeps of what it was asked and what it replied.
  • Parameter: an extra piece of information attached to a web address, usually after a question mark.
  • PURGE: a non-standard method understood by Varnish that tells it to throw away a saved copy of a page.
  • Query string: the part of a web address that carries parameters.
  • Remediation: the fix applied to close a security problem.
  • Response ID: an identifier the server returns with a reply, used to match a reply to a request in the logs.
  • Reverse proxy: software that sits in front of a website, handling requests on its behalf.
  • Severity: a rating of how serious a security problem is.
  • Triage: the stage where a program reviews a report and decides what to do with it.
  • 200 OK: the standard code meaning a request succeeded.
  • 403 Forbidden: the standard code meaning you are not allowed to do this.
  • 405 Method Not Allowed: the standard code meaning this type of request is not accepted here.
  • Varnish Cache: software used by large sites to store and serve cached copies of content quickly.

More by Mephisto

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.