A response can be correctly authorized at the origin and still reach the wrong user from a shared cache. The dangerous case is specific: user A requests a private invoice or report, an edge or reverse proxy stores the response under a key that does not separate identities, and user B or an anonymous visitor later receives A’s body. A header screenshot cannot answer whether that happened.

This article gives a buyer an acceptance method for one named route, cache policy, and release. It narrows the cache row in the broader web application vulnerability testing guide into a controlled identity sequence, evidence matrix, and retest.

Define the claim before sending requests

Write the result you need to accept: “For route /billing/report, release R and cache-policy revision C, a response created for A is never served from a shared cache to B or an anonymous context.” Name the host, method, query shape, response status, authenticated roles, tenant relationship, CDN zone, reverse-proxy tier, and whether browser storage is also in scope.

Browser history, a browser cache, a service worker, a reverse proxy, and a CDN edge are different stores. OWASP’s browser-cache guidance explicitly separates browser history from HTTP cache behavior. Seeing A’s old page after pressing Back may be a local-browser exposure; seeing A’s synthetic marker in B’s clean cookie jar points to a cross-context delivery path. Keep these findings separate even when both need remediation.

At scope planning, include two independent test accounts, an anonymous context, synthetic objects, permitted regions or points of presence, configuration access, and safe-stop conditions. Owning the hostname does not authorize intrusive testing of a CDN provider’s infrastructure. The assessment uses normal traffic to owned application routes, agreed configuration evidence, and the provider’s rules.

Reconstruct the complete cache decision path

Draw the path from browser to origin before interpreting HIT, MISS, or a response header. A request may pass through a service worker, corporate proxy, CDN, gateway, application reverse proxy, fragment cache, and application code. Each layer can have a different key, freshness rule, bypass condition, and purge mechanism.

For the named route, collect the origin policy and every effective override: cache rules, workers or edge code, gateway configuration, reverse-proxy snippets, response transformations, and deployment version. Cloudflare, for example, documents a default behavior that follows origin cache headers unless an edge rule overrides them. Its current Origin Cache Control behavior also changes how directives such as no-cache, Authorization, and Set-Cookie are treated. Those are provider- and configuration-specific facts, not a universal CDN model.

Pentest.red can help map the authorized request path from application response to edge delivery and connect a synthetic observation to the exact rule, key, release, and configuration revision. This requires the CDN, proxy, and relevant application configuration to be included in the agreed web assessment; a black-box response alone may show impact but leave the responsible layer unknown.

Read cache directives precisely, not as an authorization policy

RFC 9111 gives the directives narrower meanings than their names often suggest. An unqualified private response is not to be stored by a shared cache, while a private browser cache may store it. A qualified private="field" protects the listed response header fields; it does not automatically make the whole body private. no-store tells a conforming cache not to store the request or response. no-cache permits storage but requires successful origin validation before reuse.

Responses to requests carrying Authorization are restricted in a shared cache, but explicit response directives can permit shared storage. Cookies and Set-Cookie are not a protocol-wide authorization guarantee either; actual treatment depends on the cache and its configuration. Vary selects representations by nominated request headers under HTTP semantics, but it does not decide whether B is authorized to read A’s data. A vendor may also require a specific Vary feature or rule before those fields enter its cache key.

Treat headers as inputs to the decision, then verify effective behavior. A request-side no-cache or browser “disable cache” option can force a different path and hide the condition under test. A random query nonce may create a new key or be ignored by a rule; repeated misses do not establish that the original cacheable variant was exercised. Preserve the production key shape unless the agreed scenario is specifically about a query variant.

Test both identity directions with positive controls

Prepare A and B with synthetic responses whose markers contain no personal data or secrets. On an identity-relative route such as “my report,” first confirm through an explicitly bypassed control that the same URL returns A’s marker to A and B’s marker to B. If the application also has a separately approved object-ID route, use that route to confirm denial of a foreign object. Confirm that the anonymous path behaves as designed. These controls show that accounts, routing, and objects are valid before cache behavior is interpreted.

Then use clean, isolated cookie jars. Within each pair, keep the URL and every non-identity variant input constant, change only the approved identity context, and record the effective key on both requests. If the secure design includes validated identity in the key, the two effective keys should legitimately differ; never make B send A’s cookie or spoof an identity merely to force a match. Record key composition and a nonsecret correlation reference in the report rather than raw session cookies or tokens. If diagnosis requires a complete technical trace, agree restricted access and its retention period separately.

  1. request the identity-relative route as A through the ordinary path;
  2. hold the URL and non-identity variant inputs constant and repeat as B and then anonymously;
  3. warm the same route as B, then repeat as A and anonymously;
  4. repeat the sequence for every agreed status, query, language, device, or header variant that the effective key or rule treats separately.

Do not infer the serving layer from one Age or vendor cache-status header. RFC 9111 defines Age as an estimate accumulated across caches and transit. Correlate the marker, response identity, edge logs, origin request ID, cache status, rule match, and origin access log. If B receives A’s private marker, the cross-user delivery is proved; attributing it to a particular cache still requires this correlation. An observed disclosure remains confirmed even when the responsible layer is unknown: missing telemetry limits the cause attribution, not the observed impact.

The authenticated scanner coverage guide explains why each role needs isolated state. Here isolation is also the experiment: a shared cookie jar or reused browser profile can turn a local artifact into a false cache finding.

Use an evidence matrix, including blocked results

The following matrix is a buyer artifact, not a universal standard. Fill it for each route and effective key variant.

Scroll sideways to compare

SequenceRequired controlEvidencePassing resultBlocked condition
A warms → B readsA and B have valid separate sessionsSynthetic marker, both effective keys, request IDs, edge and origin correlationB receives only B’s authorized response or a denialB session, object, or route baseline is invalid
A warms → anonymous readsAnonymous behavior is knownSame route and non-identity variants, with both effective keys recordedNo private A body reaches anonymous contextThe anonymous route or intended denial cannot be verified
B warms → A readsThe self route returns B’s distinct synthetic response at originReverse-direction marker and logsA receives A’s response, never B’s bodyA or B baseline, route, or correlation is unavailable
Origin bypass controlBypass path is authorized and documentedOrigin response plus policy revisionThe self route returns each account’s own marker and the expected anonymous outcome; a foreign object is denied only where an explicit object route existsBypass changes application behavior or is unavailable
Path/query variantVariant is listed in scope and normalizes as documentedEffective key, rule match, content type, responseVariant preserves identity isolationProvider or routing behavior is unknown
After fix and purgeNamed release and cache configuration are deployedDeployment ID, purge scope, repeated matrixBoth directions and anonymous checks passPurge evidence or one cache layer is unavailable

A MISS followed by a denial is a useful control, but it does not prove that a previously stored variant cannot leak. A HIT is useful only when the team knows which representation and key it refers to. A private response that deliberately bypasses shared storage can pass without any private-response HIT when the policy trace, ordinary origin controls, and an approved public-cache positive control confirm that the intended branch was exercised. If the route or identity baseline is unreachable, the effective policy cannot be observed, or it is unknown whether the relevant condition ran, mark the row unknown / verification blocked, not passed. Never force a private response into cache merely to produce a hit.

Work through a fictional billing-report scenario

Assume a fictional SaaS application serves /billing/report?month=2026-09 through a CDN and an internal reverse proxy. Account A owns a synthetic report containing marker REPORT-A; account B owns REPORT-B. Anonymous visitors should be redirected without a report body. This is an illustrative test design, not a customer case or a performed test.

The team first proves through an authorized origin-bypass control that the same self-service URL returns REPORT-A to A, REPORT-B to B, and no report body to the anonymous context. It then observes that the edge key contains the path and query but not an identity-bearing property, while an edge rule makes successful HTML responses cacheable. A warms the ordinary route. Keeping the URL and non-identity inputs constant, B requests it with a separate cookie jar; because the vulnerable key omits identity, the recorded effective key is the same. B receives REPORT-A with matching edge evidence, while the origin receives no B request. That combination proves shared-cache delivery; the cache-status header alone would not.

The team also checks agreed owned path variants because the application maps an added file-like suffix back to the report handler. This is done only for routes named in scope, with synthetic data and no attempt to manipulate provider infrastructure. Provider protections against cache deception can reduce one configuration-specific path, but the application still needs correct routing, content type, cache policy, and authorization behavior.

Prove private-response isolation
  1. BaselineConfirm A, B, and anonymous behavior with separate state and synthetic objects
  2. WarmExercise the ordinary route without adding a nonce that changes the cache key
  3. Cross-checkRun A to B, A to anonymous, and B to A on the same recorded variants
  4. CorrelateTie body marker, key, rule, edge status, origin request, release, and configuration
  5. RetestDeploy the fix, purge every affected layer and variant, then repeat the same matrix

Fix the policy, purge old variants, and retest the named change

The engineering fix should match the root cause. It may require changing origin response policy, removing an unsafe edge override, correcting the cache key, separating authenticated routes, fixing path normalization, or preventing a personalized response from reaching a cacheable handler. Adding a user cookie to the key can reduce mixing but may create many sensitive cache entries; it is not automatically the right design. Vary is representation selection, not a substitute for authorization.

Changing the response to no-store stops conforming caches from storing future responses; it does not prove that older objects were removed. Expiry and purge are also different conclusions. Purge the known variants at every affected layer using the provider’s actual key semantics, and preserve the result. Cloudflare documents that a purge by URL must include headers and query strings used in a custom key, and that Worker-defined custom keys have different purge limits. When CloudFront CacheTagConfig is enabled and the cached objects carry the recorded tag, tag invalidation applies to all variants bearing that tag; it does not cover untagged old objects. These examples show why a generic “purge complete” screenshot is insufficient.

The retest records the application release, cache-policy revision, purge operation and scope, tested points of presence, and any unobservable layer. It repeats the same A→B, A→anonymous, and B→A sequence with the URL and non-identity inputs unchanged while recording any legitimate identity-based key separation. It also confirms approved public content still caches where intended, so the fix did not silently disable the positive use case everywhere.

Logout is not evidence that a copy already delivered to another context disappeared. Nor can a normal cache purge guarantee deletion of a response already downloaded by a client. Those are residual-impact boundaries, not reasons to delay the application and cache fix.

Accept the result as a bounded evidence chain

The acceptance package should contain the route inventory, identity matrix, synthetic marker design, origin and edge policy, effective key, rule order, deployment identifiers, request correlations, purge evidence, and all blocked variants. It should state separately what was observed at the browser, reverse proxy, and CDN. A body comparison without configuration can prove impact; configuration without the two-identity sequence cannot prove isolation.

In an authorized web application penetration test, Pentest.red can reproduce a leak only with synthetic records, give engineers the precise route/key/policy evidence and remediation priority, and retest the named release and cache revision after purge. The application owner deploys the fix, the cache owner performs the purge, and the assessment verifies the agreed paths. Third-party CDN internals and copies already obtained outside the controlled scenario remain explicit limits.

A passing conclusion is therefore narrow: under the listed release, configuration, routes, key variants, identities, locations, and observation window, no private synthetic response crossed contexts in the repeated matrix, while the expected public cache behavior still worked. Anything unavailable stays “verification blocked.”

PENTEST.RED

Discuss pentest scope and pricing

We start by agreeing on systems, access, constraints and the expected evidence.

Prepare your testing scope

Based on in-depth research, edited for clarity and practical use.

PENTEST.RED / RED JOURNAL