Menu

1 / 15

React's XSS protection didn't save this app — a ref callback killed it

DEV Community: react·Oopssec Store·17 days ago
#AtPYVHm6
#devtoreact#devto#dev#review#store
Reading 0:00
15s threshold

Exploiting stored cross-site scripting in OopsSec Store's product review functionality to execute JavaScript in every visitor's browser.

The product reviews feature in OopsSec Store doesn't sanitize input. At all. You can drop a <script> tag into a review, it gets saved to the database, and it runs in every visitor's browser. Here's how to go from a comment box to stealing a flag.

Lab setup

From an empty directory:

npx create-oss-store oss-store cd oss-store npm start

Enter fullscreen mode

Exit fullscreen mode

Or with Docker (no Node.js required):

docker run -p 127.0.0.1:3000:3000 leogra/oss-oopssec-store

Enter fullscreen mode

Exit fullscreen mode

The app runs at http://localhost:3000 .

Vulnerability overview

Users can submit reviews on product pages. Those reviews get stored in the database and displayed back when someone loads the page. The problem: the server saves whatever you type without sanitization, and the frontend renders it as raw HTML.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.