Skip to content
XSS Write-up Beginner

Stored XSS in OopsSec Store Lets a Single Review Run JavaScript o

The product review feature stored user-supplied content without sanitisation and rendered it as raw HTML, so a submitted script executed in every visitor's browser. An attacker could run JavaScript in a victim's authenticated session and call internal endpoints.

OopsSec Store Follow

Published on medium.com

In this lab, we’re going to exploit a stored XSS in OopsSec Store’s product reviews. You’ll inject JavaScript into a review, have it stored in the database, and watch it execute every time the page loads.

OopsSec Store, 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

The backend stored review content without sanitisation and the frontend injected it as raw HTML instead of letting React escape it.

Impact

The script ran in the victim's authenticated session and could access a protected endpoint, and it would execute for every viewer of that product page.

What the attacker needed

Local lab instance running; ability to post a review

The fix

Sanitise review content on the server before storing it and render it as escaped text in React rather than raw HTML.

How it was found

  1. Open any product page and scroll to the Reviews section.
  2. Enter a script payload in the review textarea.
  3. Submit the review; the API stores it in the database.
  4. Reload the product page; the stored script executes.

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 stored cross-site scripting (XSS) flaw means a website saves harmful code and shows it to other people. Here, a review box accepted JavaScript and displayed it as part of the page, so the code ran in every shopper's browser. That let the attacker act as the logged-in user, for example by fetching a secret value.

What is XSS?

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

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.