Skip to content
XSS Write-up Intermediate

Reflected XSS via Cache Poisoning

The web application reflected an arbitrary GET parameter into the DOM without sanitisation, initially causing self-XSS. Because the response was cached, the malicious script was stored and served to other users, turning it into a persistent XSS attack.

majix_de Follow

Published on medium.com

During a recent penetration test of a web application, we discovered a Cross-Site Scripting (XSS) via caching vunlerabillity. This article explores the discovery, exploitation, and mitigation of this issue to help developers and security professionals better understand and protect against similar vulnerabilities.

Majix, on medium.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 application reflected unsanitised user input into the DOM and the caching layer stored the response without proper validation.

Impact

An attacker could execute arbitrary JavaScript in the context of other users' sessions, potentially leading to data theft or other malicious actions.

What the attacker needed

Victim visits a crafted URL; caching enabled for the page

The fix

The application should sanitise user input before reflecting it into the DOM and configure caching to avoid storing responses containing user-supplied content.

How it was found

  1. Send a request with a malicious payload in a GET parameter.
  2. Observe that the payload is reflected in the HTML response and cached.
  3. Access the cached page to trigger the script execution.

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.

When a website takes something you type in the address bar and puts it directly on the page without cleaning it, an attacker can insert code that runs in your browser. Normally this only affects the attacker themselves, but if the website saves that page in a cache (a temporary storage), other visitors can get the malicious code too.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by majix_de

View all

2 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.