← Web Cache Poisoning lesson
Web InfrastructureWeb Cache PoisoningAdvanced45 min+100 XP

Billing Cache

The Billing Cache keys cached responses by path only while rendering a forwarding header. Prime the cache and then request the page normally.

“The cache remembered a page for everyone. The attacker taught it a secret.”

CWE-444OWASP Top 10 A05:2021OWASP ASVS 14.4.1
The story
A cache is shared memory. Its key is a policy about which inputs define a distinct response. Any input that changes the body but is missing from the key can poison every later visitor.

The edge caches by path only, but the origin renders a page using a forwarding header. The attacker sends the internal header first; the poisoned response is stored and served to normal requests.

Your objective
  • Inspect the cache key
  • Send the poisoning header to the cached route
  • Request the same path normally and capture the cached flag
Boundary under test

Request header to cache key

Field guide · request anatomy

Where to look before you type a payload

01Request

A client sends a request with headers, cookies, query parameters and a path.

02Key

The cache derives a key from a subset of the request, often host, path and selected headers.

03Miss and forward

On a miss, the request goes to the origin, which may use an unkeyed input in the response.

04Store

The cache stores the response under the key, including the attacker-influenced content.

Progressive hints

Open one hint at a time. The first two build the model; the last two point at the boundary.

Hint 1

Find the cached page.

Hint 2

Identify an input that changes the body but not the key.

Hint 3

Send x-original-host: admin.orbit.local to /page, then request the same path normally.

Hint 4 · near the answer

Request the same path normally and capture the cached flag.

Guided workbench

Observe → Hypothesize → Test → Prove → Explain

This is the same loop a reviewer expects in a report. Your draft stays in this browser; nothing is submitted until you choose to export it.

0/15steps complete
Observe0/3
Hypothesize0/3
Test0/3
Prove0/3
Explain0/3

Evidence log

Write for a reviewer who was not in the room. Every claim needs a request, response or state change behind it.

Preview the evidence report
# Lab evidence report — Billing Cache

- Family: Web Cache Poisoning
- Lab ID: web-cache-billing
- Date: 2026-12-05

## Workflow

### Observe

- [ ] Open "Billing Cache" and record /page, the HTTP method and the role you are given.
- [ ] List every parameter, header, cookie and object identifier the normal flow exposes.
- [ ] Save a baseline response: status, body shape, timing and the fields that change by user.

### Hypothesize

- [ ] Name the server decision that protects /page, and the evidence it should use.
- [ ] Use the clue as a constraint, not an answer: Send x-original-host: admin.orbit.local to the page once, then request the same path without the header.
- [ ] Predict the exact status, body or state change that would prove the decision is missing.

### Test

- [ ] Start from the baseline and change one value: the x-original-host header.
- [ ] Keep the request replayable; vary encoding, method or identifier location only after the first result.
- [ ] Capture the full request and response for the winning attempt, including the flag.

### Prove

- [ ] Capture the flag and name the exact foreign object, role or state change it proves.
- [ ] Repeat from a clean session and confirm the result is not cached or stale.
- [ ] State impact precisely: what data or action did you actually obtain?

### Explain

- [ ] State the root cause without naming the payload: which decision failed?
- [ ] Name the control that prevents recurrence and the layer where it belongs.
- [ ] Write one regression test that fails before the fix and passes after it.

## Evidence

### Target and baseline

_Not recorded._

### Hypothesis

_Not recorded._

### Winning request

_Not recorded._

### Proof

_Not recorded._

### Root cause

_Not recorded._

### Control and regression test

_Not recorded._

## Analyst conclusion

The proof demonstrates the missing control above. The regression test should fail against the vulnerable behavior and pass after remediation.
Solution and debrief
Locked until you capture the flag.

The full request, the reasoning and the debrief unlock after a successful capture. That is deliberate: struggle first, then consolidate.

What a reviewer will ask

False positives to rule out

  • A header changes the response for your request only: check whether a second client receives the same poisoned body.
  • The cache returns a miss every time: your request may bypass the cache due to cookies or cache-control.
  • A query parameter is reflected: it may be keyed or excluded from caching; verify with a clean cache and a second client.

Regression tests to name

  • Unkeyed header: The header is stripped and the response is unchanged
  • Second client: It receives the canonical response, not the poisoned one
  • Personalized response: The cache does not store or serve the personalized body
The defender's move
  • Include every response-changing input in the cache key or Vary header.
  • Do not cache authenticated or personalized responses.
  • Normalize and strip untrusted headers at the edge.
See the secure-code pattern and all 4 regression tests →
الخلاصة

إذا غيّر الهيدر الاستجابة ولم يدخل في مفتاح الكاش، فالكاش قابل للتسميم.