← Cache Deception lesson
Web InfrastructureCache DeceptionAdvanced35 min+150 XP

Semicolon Path Confusion

The Billing Portal cache uses a path-based static-asset rule while the origin serves a private account page. Make the victim bot visit the crafted asset path, then retrieve the cached private response without a session.

“The account page was never public, but the CDN stored it at /account/profile.css and served it to anyone who asked.”

RFC 9111: HTTP CachingRFC 3986: Uniform Resource Identifier syntax and normalizationOWASP Web Security Testing Guide: Web Cache DeceptionOWASP ASVS v4.0.3, chapter 14: configuration and cache controlsCDN vendor documentation for cache keys, origin headers and path normalization
The story
A cache is a second authorization boundary. The origin decides who may see a response; the cache decides which URL key that response belongs to. If the two disagree about what is private, a private response can be stored under a public key.

CDNs commonly cache responses by file extension or path pattern while the origin routes by path prefix. Appending a static-looking suffix such as .css, ;.css or an encoded slash makes the CDN treat a personalized page as a static asset. The origin still renders the victim's data, and the cache stores it under an attacker-known key. The attacker then requests that key without a session and receives the private body.

Your objective
  • Inspect the cache and origin path rules
  • Report the crafted asset path to the victim bot
  • Retrieve the cached private response without a cookie
  • Capture the flag
Boundary under test

Browser to CDN edge

Field guide · request anatomy

Where to look before you type a payload

01Route

The application serves a private page at a path such as /account/profile and renders data from the victim's session.

02Disagree

The CDN decides cacheability from a suffix or pattern, while the origin router decides the resource from a prefix or normalized path.

03Poison

The victim opens a crafted URL like /account/profile.css. The origin returns the private profile, and the CDN stores it because the path looks static.

04Store

The private body is written under a cache key the attacker knows, often with a long TTL and without Vary: Cookie.

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 account page that contains a secret and note the exact cache rule described by the lab.

Hint 2

The crafted path must look like a static asset to the cache while still routing to the private page at the origin.

Hint 3

The cache treats /account/profile;.css as a static asset while the origin routes it to /account. Report it to the bot, then fetch the same path without a cookie.

Hint 4 · near the answer

A successful exploit returns the private body from the cache with no cookie and no login.

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 — Semicolon Path Confusion

- Family: Cache Deception
- Lab ID: web-cachedeception-semicolon
- Date: 2026-12-05

## Workflow

### Observe

- [ ] Open "Semicolon Path Confusion" and record the entry point, 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 the entry point, and the evidence it should use.
- [ ] Use the clue as a constraint, not an answer: Report /account/profile;.css to the bot, then open the same path without a session. The cache stores the private response because it looks like a static file.
- [ ] 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 /account/profile;.css cache key.
- [ ] 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

  • The URL ends in .css but the origin returns 401 or a login page; no private data was stored.
  • The response is cached but contains only public static content, so there is no confidentiality impact.
  • The cache stores a personalized error page with no user-specific data; rate it as a lower-severity information leak only if it reveals something sensitive.

Regression tests to name

  • Private page with a static suffix is not cached: The response carries Cache-Control: private, no-store and a later anonymous request reaches the origin and is denied
  • Semicolon and encoded slash variants are rejected: They resolve to the account route, remain uncached and require a session
  • Static allowlist only: The path is not eligible for shared caching even if the origin returns 200
The defender's move
  • Mark every authenticated response Cache-Control: private, no-store and Vary: Cookie, and make the CDN honor origin headers.
  • Cache only an explicit allowlist of static routes after canonicalizing the path; never infer cacheability from a suffix.
  • Normalize and reject ambiguous path encodings at the edge so the origin and the CDN agree on one resource key.
  • Strip session cookies from static asset routes and add regression tests that request private pages with asset-like suffixes.
See the secure-code pattern and all 4 regression tests →
الخلاصة

Cache Deception تحدث عندما تختلف قاعدة التخزين في الـCDN عن قاعدة التوجيه في الأصل. يضيف المهاجم لاحقة تشبه ملفًا ثابتًا إلى صفحة خاصة، فيخزّن الـCDN استجابة المستخدم المصادق تحت مفتاح عام. الحل: عدم تخزين الاستجابات المصادق عليها، وتطبيع المسارات، والسماح بقائمة صريحة من الأصول الثابتة فقط، مع اختبارات انحدار تطلب الصفحات الخاصة بلواحق تشبه الأصول.