From 0368583cfc7ae8992a31c77b42e7ae53b5bbd7a9 Mon Sep 17 00:00:00 2001 From: kangfenmao Date: Tue, 19 Aug 2025 18:11:20 +0800 Subject: [PATCH] refactor(Markdown): update disallowed elements to include 'script' for enhanced security --- src/renderer/src/pages/home/Markdown/Markdown.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/src/pages/home/Markdown/Markdown.tsx b/src/renderer/src/pages/home/Markdown/Markdown.tsx index e916cd6fba..4c7b6fea1a 100644 --- a/src/renderer/src/pages/home/Markdown/Markdown.tsx +++ b/src/renderer/src/pages/home/Markdown/Markdown.tsx @@ -36,7 +36,7 @@ import Table from './Table' const ALLOWED_ELEMENTS = /<(style|p|div|span|b|i|strong|em|ul|ol|li|table|tr|td|th|thead|tbody|h[1-6]|blockquote|pre|code|br|hr|svg|path|circle|rect|line|polyline|polygon|text|g|defs|title|desc|tspan|sub|sup)/i -const DISALLOWED_ELEMENTS = ['iframe'] +const DISALLOWED_ELEMENTS = ['iframe', 'script'] interface Props { // message: Message & { content: string }