fix(security): sanitize CMS content to prevent XSS attacks
- Add DOMPurify to sanitize HTML content in LegalPage component - Prevents stored XSS vulnerabilities in CMS-managed content - Maintains legitimate HTML formatting while removing malicious scripts - Addresses critical XSS vulnerability from security scan 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@ import { useParams, Link, useNavigate } from 'react-router-dom';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { ArrowLeft, Home } from 'lucide-react';
|
||||
import DOMPurify from 'dompurify';
|
||||
import { Loading, Card } from '../../components/common';
|
||||
import { cmsService } from '../../services/cms.service';
|
||||
import { api } from '../../config/api';
|
||||
@@ -103,7 +104,7 @@ export const LegalPage: React.FC = () => {
|
||||
|
||||
<div
|
||||
className="prose prose-neutral max-w-none"
|
||||
dangerouslySetInnerHTML={{ __html: page.content }}
|
||||
dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(page.content) }}
|
||||
/>
|
||||
|
||||
</Card>
|
||||
|
||||
Reference in New Issue
Block a user