Web Security / Advanced: assurance, supply chain, and recovery / Lesson 21
Verify protected response isolation across caches
Test authorization and cache boundaries with two synthetic users and an isolated proxy.
On this page
Lesson goals
- Separate application authorization from cache behavior.
- Design a two-user synthetic isolation test.
- Verify allowed and denied paths after a bounded repair.
Define the protected response boundary
A protected web response can pass through an application, reverse proxy and browser before reaching a user. Each boundary has a role: the application decides whether the requester may access the resource, while caches follow their configured storage and reuse policy. In a fictional isolated lab, two synthetic users request a private report. Define the expected access and cache behavior with the service owner before testing. Never use real customer records or an unauthorized shared cache for this exercise.
Separate authorization from caching
A cache hit is not an authorization decision. For sensitive responses, choose cache controls and intermediary configuration appropriate to the documented policy, and verify that user-specific content is not served to another principal. The first table states the lab authorization expectation; it does not imply that all responses should use the same caching strategy. Record which layer creates the response, what headers it emits and which layer may store or reuse it without recording session tokens.
Request | User | Expected
report A | user A | permitted
report A | user B | denied
The table describes expected decisions and evidence, not an executed request.
Design a two-user experiment
Create synthetic users A and B and a report owned only by A. First request the report as A, then request the same resource as B through the same controlled proxy. Record the authorization decision, response status and safe marker in the body, with credentials redacted. Confirm B is denied and receives no copy of A’s synthetic marker. Repeat with an allowed B-owned report so the test checks a functioning authorized path as well as the negative case.
Diagnose the responsible boundary
If B receives A’s marker, compare a direct application request with the proxied request and inspect the relevant cache behavior and response headers. The second table separates the application decision from the caching boundary. Preserve sanitized evidence and change one suspected setting in a disposable environment. Do not simply disable all security checks or flush a shared production cache. If the direct application also authorizes B incorrectly, repair that authorization defect independently of the cache configuration.
Boundary | Evidence
application | authorization decision
cache | approved storage and key behavior
The table describes expected decisions and evidence, not an executed request.
Verify the repair across the path
After the approved correction, repeat both user orders with fresh synthetic sessions and records, then verify the direct and proxied paths. Check that denied requests leave protected state unchanged and that expected allowed access still works. Record the artifact, configuration, cache policy and observation window. A controlled two-user test provides evidence for those paths and settings; it cannot prove that every intermediary, resource or cache key in a distributed system is safe.
Common errors and fixes
Treating a cache hit as proof of authorization
- Why it happens
- The cache may reuse a response without making the application decision.
- How to fix it
- Review application access and cache policy separately.
- Prevent it next time
- Test two principals through each relevant boundary.
Changing a shared cache while diagnosing a lab issue
- Why it happens
- The diagnostic scope is not isolated.
- How to fix it
- Stop and use the approved recovery procedure.
- Prevent it next time
- Reproduce with disposable infrastructure and synthetic data.
Testing only the denied request
- Why it happens
- A broken service can deny everyone and appear secure.
- How to fix it
- Verify a legitimate allowed request too.
- Prevent it next time
- Pair positive and negative authorization cases.
2 practice exercises
1. User B receives A’s synthetic marker through a proxy. What comparison helps locate the boundary?
Show worked solution
Compare B’s direct application request with the proxied request and inspect the authorization and cache evidence separately. Preserve redacted responses.
2. Both A and B are denied after a change. Is that sufficient verification?
Show worked solution
No. Verify that A still receives the permitted report and B remains denied, then inspect protected state and the relevant cache policy.
Key takeaways
- A cache and an application enforce different boundaries.
- Test allowed and denied behavior with isolated synthetic users.