fix(audit): sécurité + perf + DB — 40 problèmes adressés
SÉCURITÉ (CRITIQUE): - link-preview: auth() obligatoire + filtre IP privées (SSRF fix) - metrics: !metricsToken → 401 au lieu d'etre ouvert si token absent - contextual-ai-chat: DOMPurify.sanitize() sur dangerouslySetInnerHTML (XSS fix) PERFORMANCE: - graph/route.ts: take:500 + orderBy updatedAt desc (pas de full table scan) - syncAllEmbeddings: batch parallèle Promise.allSettled × 5 (pas séquentiel) - 80 console.log supprimés du code production BASE DE DONNÉES: - Note: index contentUpdatedAt + isPublic ajoutés au schema - DocumentChunk: commentaire index vectoriel HNSW (à exécuter manuellement)
This commit is contained in:
@@ -18,6 +18,7 @@ import {
|
||||
Tag as TagIcon, RefreshCw,
|
||||
} from 'lucide-react'
|
||||
import { motion, AnimatePresence } from 'motion/react'
|
||||
import DOMPurify from 'dompurify'
|
||||
import { exportExcalidrawSceneToPngBlob } from '@/lib/client/excalidraw-export-image'
|
||||
import { useLanguage } from '@/lib/i18n'
|
||||
import { MarkdownContent } from '@/components/markdown-content'
|
||||
@@ -718,7 +719,7 @@ export function ContextualAIChat({
|
||||
<div
|
||||
className="prose prose-sm dark:prose-invert max-w-none"
|
||||
dir="auto"
|
||||
dangerouslySetInnerHTML={{ __html: actionPreview.text }}
|
||||
dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(actionPreview.text) }}
|
||||
/>
|
||||
) : (
|
||||
<MarkdownContent content={actionPreview.text} />
|
||||
|
||||
Reference in New Issue
Block a user