From d3aa10c769d25ddc8aee5c637fa657c6e2d1de3f Mon Sep 17 00:00:00 2001 From: devops Date: Sun, 18 Oct 2026 16:09:36 +0000 Subject: [PATCH] fix(security): sanitize dynamic HTML rendering in Hero and ProductPage [FE-006] --- frontend/application/components/Hero.tsx | 3 ++- frontend/application/components/ProductPage.tsx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/application/components/Hero.tsx b/frontend/application/components/Hero.tsx index 08cb2915..dbe75c66 100644 --- a/frontend/application/components/Hero.tsx +++ b/frontend/application/components/Hero.tsx @@ -1,3 +1,4 @@ +import { sanitizeBlogHtml } from "../lib/sanitizeBlogHtml"; import Image from "next/image"; import { motion, AnimatePresence, animate } from "motion/react"; import { ChevronLeft, ChevronRight, Globe, ShieldCheck, Calendar, ArrowLeft } from "lucide-react"; @@ -134,7 +135,7 @@ export default function Hero({ banners = [], onShopNavigate }: { banners?: Banne suppressHydrationWarning className="text-sm lg:text-xl text-medical-gray-600 mb-3 sm:mb-5 max-w-2xl mx-auto lg:mx-0 leading-relaxed font-vazir animate-fade-in [&_p]:text-sm [&_p]:lg:text-xl [&_p]:leading-relaxed [&_p]:my-0 [&_span]:text-inherit" dangerouslySetInnerHTML={{ - __html: subtitle + __html: sanitizeBlogHtml(subtitle) }} /> diff --git a/frontend/application/components/ProductPage.tsx b/frontend/application/components/ProductPage.tsx index 8dca46fb..68de62f0 100644 --- a/frontend/application/components/ProductPage.tsx +++ b/frontend/application/components/ProductPage.tsx @@ -1,3 +1,4 @@ +import { sanitizeBlogHtml } from "../lib/sanitizeBlogHtml"; /* eslint-disable @next/next/no-img-element */ "use client"; import Link from "next/link"; @@ -880,7 +881,7 @@ export default function ProductPage({ }`} >