Skip to content
XSS Write-up Advanced

Turning a “Useless” Self-XSS into a Full PII Leak Through Bug

A self-XSS in a cookie could be turned into a reflected XSS via cache poisoning, and then chained with an OAuth redirect and cookie ordering manipulation to trigger a second XSS that exfiltrated victim PII.

Parsa Riyahi Follow

Published on medium.com

First, the technical flow: Cookie-based self-XSS → cache poisoning → reflected XSS → OAuth redirection abuse → reflected XSS → PII leak

Parsa Riyahi, 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 caching layer and the application parsed duplicate cookies differently, and the application reflected cookie values into a script context without proper sanitisation, allowing cache poisoning and XSS.

Impact

An attacker could steal a victim's PII by chaining cache poisoning, OAuth redirection, and cookie manipulation to execute two XSS payloads.

What the attacker needed

Victim clicks a link; victim logs in via OAuth; attacker can poison cache

How it was found

  1. Identify that the currency cookie is reflected inside a script tag and that uppercase script tags bypass filtering.
  2. Discover that the caching system uses shippingCountry and currency cookies as cache keys.
  3. Send a request with duplicate currency cookies so the cache stores a malicious value while the application uses a benign one.
  4. Use a URL with switchcurrency and shippingcountry parameters to set the victim's cookies to values that pass validation.
  5. Send the victim through the OAuth login flow, which redirects back to the poisoned page and triggers the first XSS.
  6. Use the first XSS to set a second malicious currency cookie after the post-login cookie, so that on redirect the second XSS executes and exfiltrates data.

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 self-XSS is a cross-site scripting bug that only affects the person who enters the malicious code, so it is usually considered low risk. The researcher found a way to make the server store (cache) the malicious code and serve it to other users, turning it into a real attack. By also abusing the login flow and how browsers order cookies, they could run a second script that stole personal information.

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 Parsa Riyahi

View all

1 more disclosed report, 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.