Skip to content
Cache bugs Write-up Advanced

*Cache Key Injection: Chaining Cache-Poisoning and CRLF Using an Unkeyed Parameter*

The caching layer included an unkeyed parameter (utm_content) in the cache key, allowing an attacker to inject CRLF sequences and poison the cached JavaScript file. This could cause malicious JavaScript to execute in visitors' browsers.

Bash Overflow Follow

Published on infosecwriteups.com

Cache key injection is a subtle but powerful web application flaw that arises when unvalidated input is incorporated into the cache key used by a reverse proxy, CDN, or other caching layer. In this lab scenario, the site’s caching mechanism mistakenly includes attacker-supplied header data (via the Pragma…

Bash Overflow, on infosecwriteups.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the caching logic failed to sanitise or restrict which request parameters could influence the cache key, allowing an unkeyed parameter to be used for injection.

Impact

An attacker could inject malicious JavaScript into cached pages, leading to widespread cross-site scripting or malware delivery at scale.

What the attacker needed

Access to the lab environment; ability to intercept and modify requests; Param Miner extension

How it was found

  1. Open the lab and observe redirects in Burp's HTTP history.
  2. Send the login and JavaScript requests to Burp Repeater.
  3. Use Param Miner to find unkeyed parameters.
  4. Add the Pragma header to reveal cache key behaviour.
  5. Identify utm_content as an unkeyed parameter and test injection.
  6. Craft requests with CRLF payloads and delimiters to poison the cache.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A cache key is like a label that decides which stored copy of a page a visitor gets. Here, the label included a part of the request the attacker could control, so the attacker could slip extra instructions into the stored copy. That let them replace a harmless script with one that runs in other people's browsers.

What is Cache bugs?

A cache and the origin disagree about a request, so a poisoned response is served to everyone or a private page is stored as public.

More by Bash Overflow

View all

35 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Web cache poisoning and deception

The lesson behind this report.

A cache and the origin disagree about a request, so a poisoned response is served to everyone or a private page is stored as public.