Stored XSS Flaw Found in Next.js Demo Store via Malicious SVG Upload

A stored cross-site scripting (XSS) vulnerability was discovered in OopsSec Store, a deliberately vulnerable Next.js e-commerce app used for security training. An attacker with admin access could upload a malicious SVG file as a product image, embedding JavaScript that executes automatically for every visitor who views the product page. The flaw existed because the server trusted the client-supplied Content-Type header without inspecting actual file contents, and the app rendered SVGs using an img tag that allowed script execution. The vulnerability affected multiple endpoints, including the product page, admin preview, and the direct file URL. Recommended fixes include magic-byte file inspection, server-side SVG sanitization with DOMPurify, and strict Content-Security-Policy headers on the uploads directory.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in