From c1f321bb9e6f1871d6d77487ff1580cc8fb0a6a1 Mon Sep 17 00:00:00 2001 From: Sameer <142401625+sameer6pre@users.noreply.github.com> Date: Tue, 24 Jun 2025 13:33:50 +0530 Subject: [PATCH] Update orbit-app/src/pages/BlogsPage.jsx in branch Precogs-fix-qdv8agly --- orbit-app/src/pages/BlogsPage.jsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/orbit-app/src/pages/BlogsPage.jsx b/orbit-app/src/pages/BlogsPage.jsx index 9716b04..8405268 100644 --- a/orbit-app/src/pages/BlogsPage.jsx +++ b/orbit-app/src/pages/BlogsPage.jsx @@ -44,7 +44,17 @@ function BlogsPage() { type="text" placeholder="Blog title" value={title} - onChange={(e) => setTitle(e.target.value)} +(e) => { + const sanitizedValue = sanitizeInput(e.target.value); // FIX: Sanitize the input to prevent XSS + setTitle(sanitizedValue); +} + +// Example sanitizeInput function +function sanitizeInput(input) { + const div = document.createElement('div'); + div.innerText = input; // Escapes HTML special characters + return div.innerHTML; +} />