From 26cda7361416b26da063e3fb5823bd91273d7b15 Mon Sep 17 00:00:00 2001 From: Kareem Roshdy Date: Tue, 10 Nov 2026 13:52:24 +0200 Subject: [PATCH] fix(xss): sanitize review HTML with DOMPurify and add CSP via helmet Close the stored-XSS path in the Reviews feature with defense-in-depth: - client: sanitizeHtml now runs review bodies through DOMPurify (allow-list of light formatting tags; strips ' + + 'click me'; + +function renderReview(body) { + const reviews = [{ _id: 'r1', rating: 5, author: { name: 'attacker' }, body }]; + return render(); +} + +describe('ReviewList renders review HTML safely', () => { + test('does not render any