From 968d9b9bddc9d051d3daabef684074f01a7e67f1 Mon Sep 17 00:00:00 2001 From: ranaashrafmoharam Date: Tue, 10 Nov 2026 12:50:48 +0200 Subject: [PATCH 1/3] tried to fix things --- client/src/lib/sanitize.js | 9 ++++++++- server/src/app.js | 16 +++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/client/src/lib/sanitize.js b/client/src/lib/sanitize.js index 1c8ed3d..d2ea1ba 100644 --- a/client/src/lib/sanitize.js +++ b/client/src/lib/sanitize.js @@ -5,4 +5,11 @@ // TODO (security): right now this returns the HTML untouched, so whatever a // reviewer typed — including ' + + '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