Web Cache Deception: URL Normalization Risks and Defenses
Understand how URL parsing differences cause web cache deception, with Rails and Spring Boot examples and practical prevention and regression testing guidance.

Web cache deception happens when a shared cache stores a private response under a URL it considers public. URL normalization discrepancies can create that mismatch: the edge and application interpret the same request differently. Prevention requires explicit response policies, consistent path handling, and tests through the deployed cache chain.
Ruby on Rails and Spring Boot applications illustrate why framework names alone cannot establish exposure. The examples below are conditional failure modes to test against your own routing, security filters, and cache rules.
At a glance
- A static-looking suffix is not evidence that a response is safe to share.
- Rails format handling and Spring path parameters create different routing questions.
- Decoding and dot-segment removal are separate from delimiter interpretation.
- Prove cross-user reuse with synthetic data; a 200 response alone proves little.
How one request acquires two meanings
The cache applies an eligibility rule, the origin selects a handler, and a cache key determines later reuse. Deception becomes possible when those decisions disagree and a private response is stored for another requester. PortSwigger’s explanation describes this failure.
Treat those as three separate review questions: What makes this request cacheable? Which application route actually answered? Can a different identity retrieve the stored response? A routing discrepancy without shared storage is a finding to investigate, rather than proof of disclosure.
Product takeaway: Review edge cache rules alongside application routes and response headers.
Normalization: decoding can change the route
Consider the illustrative path /assets/..%2faccount. If the edge classifies the literal prefix as static, but the origin decodes the slash and removes the preceding dot-segment, the application may receive /account. A private response could then be cached under an apparently static URL. PortSwigger documents this pattern.
The reverse direction also matters: a cache may normalize a path differently from the origin. That alone does not guarantee a private handler will answer. Record the original request target, the forwarded path, and the matched route instead of inferring the transformation from the final status.
Product takeaway: Document where decoding occurs and whether cache classification, key construction, and forwarding use the same representation.
Ruby on Rails: a format suffix is not a static file
Rails uses a dot to separate a route’s optional format, and dynamic segments exclude dots by default. The Rails routing guide documents format segments and route constraints. These are Rails conventions, rather than universal properties of Ruby applications.
A path such as /account.css may therefore reach format negotiation for an account action instead of a stylesheet file. Whether it returns private content, rejects the format, or fails routing depends on the route and controller. Test registered formats, unrecognized extensions, and any custom fallback behavior separately; never assume that every Rails application accepts them.
For sensitive routes, define the intended representations and reject unsupported ones. Review wildcard routes and exception handlers too. Disabling an optional format segment can narrow routing, but it does not establish a cache policy or eliminate every alternate path.
Product takeaway: Test the route and response for each suffix; keep personalized output out of shared caches regardless of format.
Spring Boot: inspect MVC, the container, and the firewall
In a Spring Boot application using Spring MVC, semicolons can introduce path parameters. Spring’s matrix-variable documentation shows how parameters coexist with route variables. A suffix-bearing path such as /account;asset.css is therefore worth testing where the deployed stack accepts it: a literal extension rule and handler matching may disagree.
This is not a universal Spring Boot vulnerability. Spring Security uses StrictHttpFirewall by default; its documentation explains that allowing semicolons requires customization. Preserve that rejection unless the application needs the feature, and review any relaxation with the cache configuration.
Parser generation also matters. Spring’s PathPattern explanation describes segment-by-segment decoding, which prevents encoded separators from restructuring the whole path during matching. It also records that suffix pattern matching was turned off by default in Spring Framework 5.3. Check the running configuration, including legacy mappings and servlet-container behavior.
Product takeaway: Capture the actual Boot, Framework, Security, container, and proxy configuration in every test report.
A practical regression test for private routes
Use an authorized staging environment with production-equivalent CDN and proxy rules, two synthetic accounts, and a harmless account-specific marker. ITGRATE recommends the following sequence, building on OWASP’s complete-cache-path guidance.
- 1.Establish a baseline. Request the private route as account A, account B, and anonymously. Record the expected identity-specific bodies and access decisions.
- 2.Change one path feature per case: an extra segment, a format suffix, a semicolon parameter, an encoded separator, or an encoded dot-segment. Include the unchanged route and an invalid random path as controls.
- 3.Use a fresh, verified cache key for each case. Confirm that your chosen test identifier participates in the key; a query parameter may be ignored. Reuse exactly that key within the case.
- 4.Request the candidate as A, then repeat it as B and anonymously without A’s credentials. Look for A’s marker and correlate edge cache status, Age where present, and origin request logs.
- 5.Record redirects without automatically following them. Distinguish a private response from a generic error, login page, or application shell. Faster delivery alone is insufficient evidence.
- 6.After remediation, repeat the same cases and verify ordinary public assets still cache correctly. Purge test entries.
A strong failure signal is another identity receiving A’s synthetic marker from shared storage. Absence of a cache-status header is inconclusive; use cache logs or controlled instrumentation.
Product takeaway: Add the observed path variants to release checks, especially after routing, proxy, or framework changes.
Prevent storage before relying on parser agreement
Set Cache-Control: no-store on responses that must not be stored. Under RFC 9111, private prohibits shared-cache storage while permitting a private cache; no-cache permits storage but requires validation before reuse. Cookies and Set-Cookie alone do not establish this protection.
Use an allowlist of genuinely public routes and responses. Avoid rules that make an arbitrary URL public solely because it ends in .css or starts with /assets. Check rule precedence and overrides, reject ambiguous paths, and separate static hosting from private application handlers where practical. OWASP recommends these controls.
Do not fix a mismatch by adding another ad hoc decode pass. Define accepted path forms, align transformations across layers, and reject inputs that cannot be interpreted consistently. Verify the delivered headers and actual cache decisions.
Product takeaway: Fix the policy and routing cause, then invalidate affected entries; changing headers does not purge old copies.
What builders should do next
ITGRATE recommends starting with one authenticated journey: map every intermediary, state which responses may be shared, and run the two-account test against its alternate paths. Assign an owner to both route behavior and edge policy. The release criterion is concrete: private content remains isolated for every accepted representation.
Sources
PortSwigger — Web cache deception
Ruby on Rails — Format segments
Spring Framework — Matrix variables
Spring — URL matching with PathPattern
Spring Security — HttpFirewall
OWASP — Web Cache Security Cheat Sheet
Technical sources reviewed on 19 November 2026 (Asia/Ho_Chi_Minh).

Related posts
Explore more articles from our team.

Understand how web cache deception leaks private data, how cache poisoning spreads harmful responses, and which controls help protect your system.

