Skip to content
Cache bugs Write-up Intermediate

One .svg and a CDN: How a File Extension Leaked Strangers' PII

A profile API returned private user data with a long-lived cache header when a static file extension was appended to the URL, allowing a CDN to cache and serve that data to unauthenticated users. An attacker could send a victim a link; once clicked while logged in, the victim's PII became publicly retrievable from the cache.

medium.com

Published on medium.com

Bug Bounty

Abhinabshrestha, 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. 11 min read.

Context

The target was a retail site whose account area is backed by a JSON API. The endpoint at the centre of the report is the authenticated profile API:

Text
/api/v2/account/profile

It is meant to return the data of the account making the request and nobody else's. The application sits behind a CDN, and the backend is a Rails application, which matters later because of how Rails routes paths with file extensions.

The bug class is Web Cache Deception (WCD), which the author credits to Omer Gil in 2017. WCD exploits a disagreement between two systems that are supposed to agree on what is cacheable and what is dynamic user data:

  • The CDN or cache decides whether to store a response mostly by looking at the URL (does it end in .svg, .css, .js, .png?) and at the cache headers.
  • The application decides what to serve based on its own routing rules.

When the app treats /profile.svg as a live API call but the cache treats it as a static image, sensitive dynamic content gets stored in a location shared across users. Two ingredients have to line up: path confusion (the app serves dynamic content for a URL that looks static) and a cache willing to store it (the response headers or the CDN's own rules allow it to be cached and re-served). This target had both.

Setup

The researcher was poking at the site's API surface with an authenticated session. The only precondition for the attack itself is that a victim clicks a link while logged in. The attacker needs no account, no session and no special tooling: a plain GET to a URL is enough.

One environmental detail shaped the testing: the CDN uses anycast routing, so the same hostname resolves to different physical edge nodes from different machines, and the cache is per-edge.

Finding it

The profile endpoint was the obvious high-value target because it returns everything the account knows about the user. Authenticated, it behaved correctly:

HTTP
GET /api/v2/account/profile HTTP/2Host: www.shop.exampleCookie: <valid session>
HTTP
HTTP/2 200content-type: application/json; charset=utf-8cache-control: private, max-age=0, no-cache, no-storeserver-timing: cdn-cache; desc=MISS

The response carried no-cache, no-store, so the CDN would not touch it. The instinct with WCD is always to ask whether the framework normalises extensions. Many backends, Rails in this case, route /profile.svg to the same controller as /profile, stripping the extension during routing. So the researcher tried it:

HTTP
GET /api/v2/account/profile.svg HTTP/2Host: www.shop.exampleCookie: <valid session>
HTTP
HTTP/2 200content-type: application/json; charset=utf-8cache-control: private, max-age=31536000     ← !!server-timing: cdn-cache; desc=MISS

Two things jumped out. First, the response still contained the full profile JSON: the extension was stripped, the same controller ran, the same data came back. Second, the Cache-Control header had completely changed. no-cache, no-store was gone, replaced by max-age=31536000, one year.

That second point is the whole bug. The framework's static-asset handling assumed anything ending in .svg was a safe, cacheable file and applied a long-lived cache header, without realising the body was private user data.

Exploitation

A changed header is a lead, not a finding. The researcher needed to prove the CDN genuinely cached the response and served it to an unauthenticated stranger. "Could lead to" is not a bug; the chain has to be built.

Step 1: seed the cache as the victim

Bash
curl -sk "https://www.shop.example/api/v2/account/profile.svg" \  -H "Cookie: <valid session>" -D -
HTTP
HTTP/2 200cache-control: private, max-age=31536000server-timing: cdn-cache; desc=MISSserver-timing: origin; dur=93x-request-id: 1fcdeb65-3a1d-40b9-86a7-d01df8bf26c4

MISS means this was the first request: it went to origin, and the CDN stored the response. The x-request-id is worth noting for the next step.

Step 2: read it back as an attacker with no cookies

Bash
curl -sk "https://www.shop.example/api/v2/account/profile.svg" -D -
HTTP
HTTP/2 200cache-control: private, max-age=31536000server-timing: cdn-cache; desc=HITserver-timing: edge; dur=1x-request-id: 1fcdeb65-3a1d-40b9-86a7-d01df8bf26c4
JSON
{  "data": {    "type": "users",    "attributes": {      "first-name": "<victim>",      "last-name": "<victim>",      "email": "[redacted]",      "email-md5": "<hash>",      "email-sha256": "<hash>",      "card-number": "<loyalty card>",      "loyalty-tier": "...",      "points": 50,      "mobile-phone": "<phone>",      "country-calling-code": "+..",      "mobile-phone-md5": "<hash>",      "admin": false,      "is-employee": false    }  }}

Three details nail it down:

  • cdn-cache; desc=HIT: the edge served this itself.
  • edge; dur=1: one millisecond, no origin roundtrip.
  • The x-request-id is identical to the victim's request. This is the same physical response object.

No account, no session, no tools: just a GET to a URL, and the attacker is holding someone else's PII. It worked in a browser too: opening the URL in an incognito window rendered the victim's data as raw JSON on screen.

The anycast gotcha

When the researcher first tried to reproduce from a second machine, the attacker request sometimes returned a sign-in error instead of cached data. It looked flaky, the kind of inconsistency that makes you doubt yourself. The cause was the CDN's anycast routing: a large CDN answers www.shop.example from many physical edge nodes, and the cache is per-edge. Two machines can resolve the hostname to two different points of presence, and the copy that was seeded lived on only one of them.

The fix for deterministic testing is curl --resolve, which pins the connection to a specific edge IP and skips DNS entirely:

Bash
# find candidate edgesdig +short www.shop.example
Bash
# pin both requests to the SAME edgecurl -sk --resolve www.shop.example:443:[redacted] \  "https://www.shop.example/api/v2/account/profile.svg" -D -

Seed and read from the same edge IP and it is fully reproducible.

The report is careful about what this pinning does and does not mean for real-world impact. --resolve is a testing convenience, not an attack prerequisite. In practice, users on the same ISP or in the same region naturally land on the same PoP, and an attacker only has to try the handful of edge IPs dig returns until one gives a HIT. The bug is real; the pinning just removes the routing variable so a triager can reproduce it in one shot. The researcher put exactly this explanation in the report as a reproduction note, with the pinned commands. The lesson drawn: if a PoC depends on an environmental quirk, explain the quirk, because many "can't reproduce, not applicable" closures happen when the triager hits the flaky path and gives up.

Root cause

The application's routing strips the extension, so /api/v2/account/profile.svg reaches the same controller as /api/v2/account/profile and returns the same private JSON. The framework's static-asset handling, however, sees the .svg suffix and applies a one-year Cache-Control header, apparently assuming the body is a safe static file. The correct private, no-cache, no-store headers that the plain endpoint emits never reach the extension-suffixed response.

The CDN then does what it is told: it caches a response whose URL looks static and whose headers permit long caching, and serves it to anyone requesting the same URL. The no-cache, no-store header on the plain API route was replaced by a one-year header on the extension-suffixed variant.

Impact

One cached response leaked, per victim:

  • Full name, email, phone number (with country code)
  • Loyalty or membership card number
  • MD5 and SHA-256 of the email, MD5 of the phone, which are offline-crackable and directly usable for cross-referencing in data-broker and breach corpora
  • Loyalty tier and points balance
  • admin and is-employee authorisation flags
  • References to shipping addresses, saved cards and stored payment tokens

The attacker needs no account. The only precondition is that the victim clicks a link while logged in, the same bar as a reflected XSS or a CSRF. Because the entry sat in cache with a one-year TTL, a single click had a long shelf life.

The researcher scored it CVSS 3.1 7.4 (High): AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N. The scope change (S:C) is described as the honest part: the vulnerability lives in the app's headers, but the data crosses the trust boundary at the caching layer, a different component from the one that is broken.

The duplicate, and getting it reopened

The report was submitted and received the standard "thanks, under review" auto-reply. A few days later the program updated it, refining the title, tagging it CWE-200 and CWE-524, and cleaning up the endpoint list. Then it was marked Duplicate: another hunter had already submitted the same bug, and the program had determined that it was not going to deploy a fix. Closed, 2 points.

Two things had happened in the meantime, and the researcher had already reported both:

  1. A request to purge the researcher's own PII from the cache. The test-account data was sitting on a public edge with a one-year TTL, and leaving it there is an ongoing exposure, not a courtesy matter.
  2. A finding that the fix was incomplete. The cached .svg variant had been removed, but .png, .jpg, .jpeg and .mp3 still cached the exact same PII, still with a roughly one-year expiry. A cache rule that blocklists one extension is not a fix; the framework's extension stripping and the CDN's cache-on-static-extension behaviour were both untouched. The "known" bug was not only unfixed, it was demonstrably still exploitable through half a dozen other extensions.

The researcher pushed back, not by arguing about points but by restating the impact and the facts: this leaks consumer PII, the remediation that was applied does not close it, and here are the extensions that still work. Politely, once, with evidence. A few days later the report was reopened, moved to under review, and accepted, with the program noting that although it was a duplicate of a previously submitted report, it was still valid because the fix was not fully implemented, and thanking the researcher for the additional context on other affected extensions. Bounty and bonus points were awarded.

The transferable lessons the author draws:

  1. "Duplicate" is a status, not a verdict on your work. A duplicate of an unfixed bug, especially one where you can demonstrate the deployed remediation is incomplete, is a live vulnerability. Bringing new, exploitable surface (new extensions, a bypass of the "fix") is frequently enough to reopen.
  2. Argue impact, never points. The reward was never mentioned; every message was about consumer PII exposure and the specific extensions still leaking.
  3. Test the fix, then test around it. When a program says "fixed", re-run the PoC and then vary the one parameter the fix depends on. Here the fix was extension-specific, so the obvious probe was other extensions.
  4. Make your PoC reproducible on the first try. The anycast and --resolve note probably saved this report; a bug that only reproduces "sometimes" reads as noise.
  5. Ask for your own data to be purged. If your PoC seeds a shared cache with your PII and a long TTL, that data is exposed until it is evicted.

Fix

The report describes the remediation that was applied as incomplete: the cached .svg variant had been removed while .png, .jpg, .jpeg and .mp3 still cached the same PII. The author's recommendations for defenders are:

  1. Never let a URL extension change cache headers on dynamic routes. Every response under /api/ should carry Cache-Control: private, no-cache, no-store, max-age=0 regardless of how the path ends, and the static-asset header logic must not reach API controllers.
  2. Do not blocklist extensions; allowlist behaviour. Removing .svg while .png, .jpg and .mp3 still leak is the exact trap this program fell into. Return 404 for any /api/ path ending in a static extension, and normalise path handling so /profile.svg never routes to the profile controller at all.
  3. Tell the CDN to never cache /api/. As defence in depth, the edge should skip caching for API paths outright and strictly honour private on anything that is not a genuine static asset.

The summary is: fix the class, not the example.

Variants to test

  • Other static extensions on the same API route. Try .png, .jpg, .jpeg, .mp3 and similar suffixes on an authenticated JSON endpoint. A positive result is the same private JSON body coming back with a long-lived Cache-Control and a cdn-cache; desc=HIT on a second, cookie-less request.
  • Path parameter and delimiter tricks. Try suffixes such as ;.css, %2e.css, or a trailing slash after the extension, where the origin ignores the extra segment but the cache keys on it. A positive result is a cached response containing data that differs per user.
  • Header-based cache keys. Check whether the CDN keys on headers the origin ignores, such as X-Forwarded-Host or a custom header, so that a poisoned or personalised response is stored under a key an attacker can request.
  • Per-edge behaviour. Resolve the hostname with dig +short and repeat the seed and read against each returned IP using curl --resolve. A positive result is a HIT on at least one edge from a request with no cookies.
  • Fix verification. After a program claims a fix, re-run the original PoC and then vary the extension, the path form and the edge. A positive result is any variant that still returns another user's data from cache, which is the evidence needed to reopen a duplicate.

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

What happened, in plain words

A shopping website had a page in its account area that returns your personal details: your name, your email, your phone number, your loyalty card number and a few other things. That page is not a normal web page you look at; it is an API endpoint, a URL that a program (or a browser running a script) calls to get data back in a machine-readable format called JSON. Think of it as a service counter: you show your membership card, the clerk goes into the back room, and comes back with a printout that has only your details on it.

The site also sits behind a CDN (content delivery network). A CDN is a worldwide network of computers that keep copies of things so that visitors get them faster. Think of it as a chain of local shops that keep popular products on the shelf instead of ordering them from the factory every time. When a CDN keeps a copy of something, we say it caches it, and the copy is called a cached copy.

Normally the profile endpoint told the CDN, in its response headers (small labels attached to the answer, like instructions written on the outside of a parcel), "do not keep a copy of this". The CDN obeyed. But the researcher found that if you added a file extension to the end of the URL, the site still returned the same private data, and this time the instructions on the parcel said "keep this for a year". The CDN obeyed that too, and started handing the private printout to anyone who asked for the same URL, with no login at all.

That is the bug class called Web Cache Deception: two systems disagree about what a URL is, and private data ends up in a shared place. The researcher reported it, it was closed as a duplicate of an earlier report that the company had decided not to fix, and then it was reopened and paid after the researcher showed that the partial fix still let the same data leak through other file extensions.

The setup: what the target was

The target was a retail site whose account area is backed by a JSON API. The endpoint at the centre of the report is the authenticated profile API:

Text
/api/v2/account/profile

This is a path, the part of a URL after the site name. If the site were www.shop.example, the full URL would be https://www.shop.example/api/v2/account/profile. The word authenticated means the server checks who you are before answering, usually by looking at a cookie or a session token: a short piece of text your browser stores after you log in and sends with every request, like a wristband you get at an event that proves you paid. The word endpoint just means a specific URL that a program can call to do something or get something.

The endpoint is meant to return the data of the account making the request and nobody else's. The application sits behind a CDN, and the backend is a Rails application. Rails is a popular framework for building web applications in the Ruby programming language. It matters later because of how Rails routes paths that have file extensions on the end.

The bug class is Web Cache Deception (WCD), which the author credits to Omer Gil in 2017. WCD exploits a disagreement between two systems that are supposed to agree on what is cacheable and what is dynamic user data:

  • The CDN or cache decides whether to store a response mostly by looking at the URL (does it end in .svg, .css, .js, .png?) and at the cache headers.
  • The application decides what to serve based on its own routing rules.

A static file is a file that is the same for everyone: an image, a stylesheet, a script. A dynamic response is one built fresh for the person asking, like your profile. The CDN's job is to be fast, so it loves static files and is suspicious of dynamic ones. The application's job is to answer correctly, so it does not care what the URL looks like.

When the app treats /profile.svg as a live API call but the cache treats it as a static image, sensitive dynamic content gets stored in a location shared across users. Two ingredients have to line up: path confusion (the app serves dynamic content for a URL that looks static) and a cache willing to store it (the response headers or the CDN's own rules allow it to be cached and re-served). This target had both.

How the researcher worked

The researcher was poking at the site's API surface with an authenticated session. curl is a command-line tool that sends web requests and prints the answers; think of it as a browser without a window, useful because it shows you the raw reply including all the headers. The only precondition for the attack itself is that a victim clicks a link while logged in. The attacker needs no account, no session and no special tooling: a plain GET to a URL is enough. GET is the basic request a browser makes when you open a page or a link.

One environmental detail shaped the testing: the CDN uses anycast routing, so the same hostname resolves to different physical edge nodes from different machines, and the cache is per-edge. Anycast means one name points to many machines around the world, and the network sends each visitor to a nearby one. An edge node is one of those machines, the one closest to you. PII stands for personally identifiable information: data that identifies a real person, such as a name, email or phone number.

Finding it

The profile endpoint was the obvious high-value target because it returns everything the account knows about the user. Authenticated, it behaved correctly:

HTTP
GET /api/v2/account/profile HTTP/2Host: www.shop.exampleCookie: <valid session>

Line by line:

  • GET /api/v2/account/profile HTTP/2 is the request line: the method (GET, meaning "give me this"), the path being asked for, and the version of the HTTP protocol used. HTTP/2 is simply a newer version of the language browsers and servers speak.
  • Host: www.shop.example tells the server which site name the request is for. One server can host many sites, so it needs to know which one you meant.
  • Cookie: <valid session> is the wristband: the session cookie proving the request comes from a logged-in user. The real value is replaced with a placeholder here.
HTTP
HTTP/2 200content-type: application/json; charset=utf-8cache-control: private, max-age=0, no-cache, no-storeserver-timing: cdn-cache; desc=MISS

Line by line:

  • HTTP/2 200 is the status line. 200 means "OK, here is your answer".
  • content-type: application/json; charset=utf-8 says the body is JSON text, encoded in UTF-8 (a standard way of representing characters).
  • cache-control: private, max-age=0, no-cache, no-store is the instruction label about caching. private means only the user's own browser may keep it, not a shared cache. max-age=0 means it is already stale. no-cache and no-store mean do not keep a copy at all. In plain words: "this is personal, do not put it on the shelf".
  • server-timing: cdn-cache; desc=MISS is a diagnostic header the CDN adds. MISS means the CDN did not have a copy and had to fetch it from the origin, the actual application server behind the CDN.

The response carried no-cache, no-store, so the CDN would not touch it. The instinct with WCD is always to ask whether the framework normalises extensions: whether it tidies up a path by removing a suffix before deciding which piece of code should handle it. Many backends, Rails in this case, route /profile.svg to the same controller as /profile, stripping the extension during routing. A controller is the piece of application code that handles a particular kind of request. So the researcher tried it:

HTTP
GET /api/v2/account/profile.svg HTTP/2Host: www.shop.exampleCookie: <valid session>

This is the same request as before, with .svg added to the end of the path. SVG is an image format, so a URL ending in .svg looks like a picture to a CDN.

HTTP
HTTP/2 200content-type: application/json; charset=utf-8cache-control: private, max-age=31536000     ← !!server-timing: cdn-cache; desc=MISS

Line by line:

  • HTTP/2 200 again means OK.
  • content-type: application/json; charset=utf-8 says the body is still JSON, not an image.
  • cache-control: private, max-age=31536000 is the surprise. max-age=31536000 means the copy may be kept for 31,536,000 seconds, which is one year. The no-cache, no-store protection is gone. The arrow and exclamation marks are the researcher's own note that this is the interesting part.
  • server-timing: cdn-cache; desc=MISS again means the CDN had no copy yet and fetched from the origin.

Two things jumped out. First, the response still contained the full profile JSON: the extension was stripped, the same controller ran, the same data came back. Second, the Cache-Control header had completely changed. no-cache, no-store was gone, replaced by max-age=31536000, one year.

That second point is the whole bug. The framework's static-asset handling assumed anything ending in .svg was a safe, cacheable file and applied a long-lived cache header, without realising the body was private user data. In everyday terms: the clerk saw the word "picture" on the envelope and wrote "keep on the public shelf for a year" on it, without opening it to see it was your bank statement.

Proving it: the cache really stores and re-serves the data

A changed header is a lead, not a finding. The researcher needed to prove the CDN genuinely cached the response and served it to an unauthenticated stranger. "Could lead to" is not a bug; the chain has to be built. A proof of concept (PoC) is the concrete demonstration that the bug works, not just that it might.

Step 1: seed the cache as the victim

Bash
curl -sk "https://www.shop.example/api/v2/account/profile.svg" \  -H "Cookie: <valid session>" -D -

Line by line:

  • curl is the tool sending the request.
  • -s means silent: do not print progress noise.
  • -k means ignore certificate warnings. Certificates are the padlocks that prove a site is genuine; this flag is a testing convenience.
  • The quoted URL is the endpoint with the .svg suffix.
  • \ at the end of a line means the command continues on the next line.
  • -H "Cookie: <valid session>" adds a header, here the session cookie, so the server treats the request as the logged-in victim.
  • -D - means print the response headers to the screen (- means standard output).
HTTP
HTTP/2 200cache-control: private, max-age=31536000server-timing: cdn-cache; desc=MISSserver-timing: origin; dur=93x-request-id: 1fcdeb65-3a1d-40b9-86a7-d01df8bf26c4

Line by line:

  • HTTP/2 200 means OK.
  • cache-control: private, max-age=31536000 is the one-year instruction again.
  • server-timing: cdn-cache; desc=MISS means the CDN had no copy and went to the origin.
  • server-timing: origin; dur=93 means the origin took 93 units of time (milliseconds) to answer. This is the slow path, the real server doing real work.
  • x-request-id: 1fcdeb65-3a1d-40b9-86a7-d01df8bf26c4 is a unique label the server attaches to this particular request and response. Remember it for the next step.

MISS means this was the first request: it went to origin, and the CDN stored the response. The x-request-id is worth noting for the next step.

Step 2: read it back as an attacker with no cookies

Bash
curl -sk "https://www.shop.example/api/v2/account/profile.svg" -D -

This is the same command with the -H "Cookie: ..." part removed. That is the whole point: no login, no wristband, just a stranger asking for the same URL.

HTTP
HTTP/2 200cache-control: private, max-age=31536000server-timing: cdn-cache; desc=HITserver-timing: edge; dur=1x-request-id: 1fcdeb65-3a1d-40b9-86a7-d01df8bf26c4

Line by line:

  • HTTP/2 200 means OK, the stranger got an answer.
  • cache-control: private, max-age=31536000 is the same one-year label.
  • server-timing: cdn-cache; desc=HIT means the CDN had a copy and served it itself. HIT is the opposite of MISS.
  • server-timing: edge; dur=1 means the edge answered in one unit of time, essentially instantly, with no trip to the origin.
  • x-request-id: 1fcdeb65-3a1d-40b9-86a7-d01df8bf26c4 is exactly the same label as the victim's request. That is the fingerprint proving this is the very same stored response, not a fresh one that happens to look similar.
JSON
{  "data": {    "type": "users",    "attributes": {      "first-name": "<victim>",      "last-name": "<victim>",      "email": "[redacted]",      "email-md5": "<hash>",      "email-sha256": "<hash>",      "card-number": "<loyalty card>",      "loyalty-tier": "...",      "points": 50,      "mobile-phone": "<phone>",      "country-calling-code": "+..",      "mobile-phone-md5": "<hash>",      "admin": false,      "is-employee": false    }  }}

This is the body of the answer, in JSON. JSON is a text format for structured data: curly braces group things, names on the left of a colon are labels, values on the right are the data. Line by line:

  • "data" is the outer container.
  • "type": "users" says this record describes a user.
  • "attributes" holds the actual fields.
  • "first-name" and "last-name" are the victim's names, replaced with placeholders here.
  • "email": "[redacted]" is the email address, a placeholder in the write-up.
  • "email-md5" and "email-sha256" are hashes of the email. A hash is a one-way scramble: you can turn text into a fixed-length code, but you cannot easily turn the code back. MD5 and SHA-256 are two hash algorithms. Hashes of known values can be looked up or guessed, which is why they still matter.
  • "card-number": "<loyalty card>" is the loyalty card number.
  • "loyalty-tier": "..." is the membership level.
  • "points": 50 is the points balance.
  • "mobile-phone" and "country-calling-code" are the phone number and its country prefix.
  • "mobile-phone-md5" is a hash of the phone number.
  • "admin": false and "is-employee": false are flags saying whether the account has special powers.

Three details nail it down:

  • cdn-cache; desc=HIT: the edge served this itself.
  • edge; dur=1: one millisecond, no origin roundtrip.
  • The x-request-id is identical to the victim's request. This is the same physical response object.

No account, no session, no tools: just a GET to a URL, and the attacker is holding someone else's PII. It worked in a browser too: opening the URL in an incognito window (a private browsing window with no cookies from your normal session) rendered the victim's data as raw JSON on screen. That is the simplest possible demonstration: paste a link, see a stranger's details.

The anycast gotcha

When the researcher first tried to reproduce from a second machine, the attacker request sometimes returned a sign-in error instead of cached data. It looked flaky, the kind of inconsistency that makes you doubt yourself. The cause was the CDN's anycast routing: a large CDN answers www.shop.example from many physical edge nodes, and the cache is per-edge. Two machines can resolve the hostname to two different points of presence, and the copy that was seeded lived on only one of them. A point of presence (PoP) is one physical location of the CDN's network.

The fix for deterministic testing is curl --resolve, which pins the connection to a specific edge IP and skips DNS entirely. DNS is the phone book of the internet: it turns a name like www.shop.example into a numeric address, an IP address. --resolve lets you say "for this name, use this address" and bypass the phone book.

Bash
# find candidate edgesdig +short www.shop.example

Line by line:

  • The line starting with # is a comment, a note for humans that the computer ignores.
  • dig is a command-line tool that asks DNS questions.
  • +short asks for a short answer, just the addresses.
  • www.shop.example is the name being looked up.

The output is a list of IP addresses, the candidate edges.

Bash
# pin both requests to the SAME edgecurl -sk --resolve www.shop.example:443:[redacted] \  "https://www.shop.example/api/v2/account/profile.svg" -D -

Line by line:

  • The comment says the goal: pin both requests to the same edge.
  • curl -sk is the same tool and flags as before.
  • --resolve www.shop.example:443:[redacted] says: when connecting to www.shop.example on port 443 (the standard port for HTTPS, the encrypted web), use the address [redacted] instead of asking DNS. The address shown is a documentation example address, not the real one.
  • -D - prints the response headers.

Seed and read from the same edge IP and it is fully reproducible.

The report is careful about what this pinning does and does not mean for real-world impact. --resolve is a testing convenience, not an attack prerequisite. In practice, users on the same ISP or in the same region naturally land on the same PoP, and an attacker only has to try the handful of edge IPs dig returns until one gives a HIT. The bug is real; the pinning just removes the routing variable so a triager (the person at the bug bounty platform or company who first reviews a report) can reproduce it in one shot. The researcher put exactly this explanation in the report as a reproduction note, with the pinned commands. The lesson drawn: if a PoC depends on an environmental quirk, explain the quirk, because many "can't reproduce, not applicable" closures happen when the triager hits the flaky path and gives up.

Root cause

The application's routing strips the extension, so /api/v2/account/profile.svg reaches the same controller as /api/v2/account/profile and returns the same private JSON. The framework's static-asset handling, however, sees the .svg suffix and applies a one-year Cache-Control header, apparently assuming the body is a safe static file. The correct private, no-cache, no-store headers that the plain endpoint emits never reach the extension-suffixed response.

The CDN then does what it is told: it caches a response whose URL looks static and whose headers permit long caching, and serves it to anyone requesting the same URL. The no-cache, no-store header on the plain API route was replaced by a one-year header on the extension-suffixed variant.

Impact

One cached response leaked, per victim:

  • Full name, email, phone number (with country code)
  • Loyalty or membership card number
  • MD5 and SHA-256 of the email, MD5 of the phone, which are offline-crackable and directly usable for cross-referencing in data-broker and breach corpora
  • Loyalty tier and points balance
  • admin and is-employee authorisation flags
  • References to shipping addresses, saved cards and stored payment tokens

"Offline-crackable" means an attacker can take the hashes away and try guesses on their own computer without touching the site. A data-broker corpus is a collection of personal data sold or shared by companies that profile people; a breach corpus is data leaked in past incidents. Matching a hash against those collections can confirm who a person is.

The attacker needs no account. The only precondition is that the victim clicks a link while logged in, the same bar as a reflected XSS or a CSRF. XSS (cross-site scripting) is when an attacker gets their own code to run in your browser through a link; CSRF (cross-site request forgery) is when a link makes your browser perform an action you did not intend. Both need one click from a logged-in user, which is why the comparison is made. Because the entry sat in cache with a one-year TTL (time to live, how long a cached copy is kept), a single click had a long shelf life.

The researcher scored it CVSS 3.1 7.4 (High): AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N. CVSS is a standard scoring system for vulnerabilities. The string is a set of measurements:

  • AV:N attack vector network: it can be done over the internet.
  • AC:L attack complexity low: no special conditions to set up.
  • PR:N privileges required none: the attacker needs no account.
  • UI:R user interaction required: the victim must click.
  • S:C scope changed: the problem crosses into another component.
  • C:H confidentiality high: a lot of secret data is exposed.
  • I:N integrity none: data is not modified.
  • A:N availability none: the service is not knocked offline.

The scope change (S:C) is described as the honest part: the vulnerability lives in the app's headers, but the data crosses the trust boundary at the caching layer, a different component from the one that is broken.

The duplicate, and getting it reopened

The report was submitted and received the standard "thanks, under review" auto-reply. A few days later the program updated it, refining the title, tagging it CWE-200 and CWE-524, and cleaning up the endpoint list. CWE is a catalogue of weakness types; CWE-200 is exposure of sensitive information, and CWE-524 is use of a cacheable response containing sensitive information. Then it was marked Duplicate: another hunter had already submitted the same bug, and the program had determined that it was not going to deploy a fix. Closed, 2 points. Bug bounty platforms often give points as a reputation score separate from money.

Two things had happened in the meantime, and the researcher had already reported both:

  1. A request to purge the researcher's own PII from the cache. The test-account data was sitting on a public edge with a one-year TTL, and leaving it there is an ongoing exposure, not a courtesy matter.
  2. A finding that the fix was incomplete. The cached .svg variant had been removed, but .png, .jpg, .jpeg and .mp3 still cached the exact same PII, still with a roughly one-year expiry. A cache rule that blocklists one extension is not a fix; the framework's extension stripping and the CDN's cache-on-static-extension behaviour were both untouched. The "known" bug was not only unfixed, it was demonstrably still exploitable through half a dozen other extensions.

The researcher pushed back, not by arguing about points but by restating the impact and the facts: this leaks consumer PII, the remediation that was applied does not close it, and here are the extensions that still work. Politely, once, with evidence. A few days later the report was reopened, moved to under review, and accepted, with the program noting that although it was a duplicate of a previously submitted report, it was still valid because the fix was not fully implemented, and thanking the researcher for the additional context on other affected extensions. Bounty and bonus points were awarded.

The transferable lessons the author draws:

  1. "Duplicate" is a status, not a verdict on your work. A duplicate of an unfixed bug, especially one where you can demonstrate the deployed remediation is incomplete, is a live vulnerability. Bringing new, exploitable surface (new extensions, a bypass of the "fix") is frequently enough to reopen.
  2. Argue impact, never points. The reward was never mentioned; every message was about consumer PII exposure and the specific extensions still leaking.
  3. Test the fix, then test around it. When a program says "fixed", re-run the PoC and then vary the one parameter the fix depends on. Here the fix was extension-specific, so the obvious probe was other extensions.
  4. Make your PoC reproducible on the first try. The anycast and --resolve note probably saved this report; a bug that only reproduces "sometimes" reads as noise.
  5. Ask for your own data to be purged. If your PoC seeds a shared cache with your PII and a long TTL, that data is exposed until it is evicted.

Fix

The report describes the remediation that was applied as incomplete: the cached .svg variant had been removed while .png, .jpg, .jpeg and .mp3 still cached the same PII. The author's recommendations for defenders are:

  1. Never let a URL extension change cache headers on dynamic routes. Every response under /api/ should carry Cache-Control: private, no-cache, no-store, max-age=0 regardless of how the path ends, and the static-asset header logic must not reach API controllers.
  2. Do not blocklist extensions; allowlist behaviour. Removing .svg while .png, .jpg and .mp3 still leak is the exact trap this program fell into. Return 404 for any /api/ path ending in a static extension, and normalise path handling so /profile.svg never routes to the profile controller at all. A 404 is the standard "not found" answer.
  3. Tell the CDN to never cache /api/. As defence in depth (layers of protection so that one mistake does not open everything), the edge should skip caching for API paths outright and strictly honour private on anything that is not a genuine static asset.

The summary is: fix the class, not the example.

Variants to test

  • Other static extensions on the same API route. Try .png, .jpg, .jpeg, .mp3 and similar suffixes on an authenticated JSON endpoint. A positive result is the same private JSON body coming back with a long-lived Cache-Control and a cdn-cache; desc=HIT on a second, cookie-less request.
  • Path parameter and delimiter tricks. Try suffixes such as ;.css, %2e.css, or a trailing slash after the extension, where the origin ignores the extra segment but the cache keys on it. A positive result is a cached response containing data that differs per user. %2e is a URL-encoded dot.
  • Header-based cache keys. Check whether the CDN keys on headers the origin ignores, such as X-Forwarded-Host or a custom header, so that a poisoned or personalised response is stored under a key an attacker can request. A cache key is the label the cache uses to decide which stored copy matches a request.
  • Per-edge behaviour. Resolve the hostname with dig +short and repeat the seed and read against each returned IP using curl --resolve. A positive result is a HIT on at least one edge from a request with no cookies.
  • Fix verification. After a program claims a fix, re-run the original PoC and then vary the extension, the path form and the edge. A positive result is any variant that still returns another user's data from cache, which is the evidence needed to reopen a duplicate.

Glossary

  • API: a set of URLs a program can call to get or change data, rather than a page meant for a human to look at.
  • Anycast: a networking setup where one name points to many machines around the world and each visitor is sent to a nearby one.
  • Authenticated: a request that proves who is making it, usually with a session cookie.
  • Cache: a stored copy of a response kept so it can be served again quickly.
  • Cache-Control: a response header that tells caches whether and how long they may keep a copy.
  • Cache key: the label a cache uses to match a request to a stored copy.
  • CDN: content delivery network, a worldwide set of servers that keep copies of content close to visitors.
  • Controller: the piece of application code that handles a particular kind of request.
  • Cookie: a small piece of text a browser stores for a site and sends back with each request, often used to prove you are logged in.
  • CSRF: cross-site request forgery, a trick where a link makes your logged-in browser perform an action you did not intend.
  • curl: a command-line tool for sending web requests and printing the replies.
  • CVSS: a standard scoring system for the severity of a vulnerability.
  • CWE: a catalogue of weakness types, with numbered entries such as CWE-200 and CWE-524.
  • Defence in depth: layering several protections so that one failure does not expose everything.
  • DNS: the system that turns a site name into an IP address.
  • Duplicate: a report describing a bug that was already reported.
  • Dynamic: a response built fresh for the person asking, as opposed to a static file.
  • Edge node: one physical machine in a CDN's network, close to visitors.
  • Endpoint: a specific URL that a program can call.
  • GET: the basic web request used to ask for something, such as opening a link.
  • Hash: a one-way scramble of text into a fixed-length code, used to compare or store values without keeping the original.
  • Header: a small label attached to a web request or response, carrying instructions or metadata.
  • HIT / MISS: cache terms for "I had a stored copy" and "I did not, so I fetched it fresh".
  • HTTP/2: a version of the protocol browsers and servers use to talk.
  • Incognito window: a private browsing window that starts without your normal cookies.
  • IP address: the numeric address of a machine on the internet.
  • JSON: a text format for structured data, using braces, labels and values.
  • MD5 / SHA-256: two hash algorithms.
  • Normalise: to tidy up a value, such as stripping a file extension from a path, before using it.
  • Origin: the real application server behind a CDN.
  • Path: the part of a URL after the site name, such as /api/v2/account/profile.
  • PII: personally identifiable information, data that identifies a real person.
  • PoC: proof of concept, a concrete demonstration that a bug works.
  • Point of presence (PoP): one physical location in a CDN's network.
  • Rails: a framework for building web applications in Ruby.
  • Reflected XSS: cross-site scripting where an attacker's code is echoed back through a link and runs in the victim's browser.
  • Session token: a value proving a logged-in session, usually stored in a cookie.
  • Static file: a file that is the same for everyone, such as an image or stylesheet.
  • SVG: an image file format, recognised by the .svg extension.
  • Triager: the person who first reviews a bug bounty report.
  • TTL: time to live, how long a cached copy is kept before it is discarded.
  • Web Cache Deception (WCD): a bug class where a cache stores private dynamic content because the URL looks static, and serves it to others.
  • x-request-id: a unique label a server attaches to a request and its response, useful for matching them up.

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.