From 03fda5526112e10b89807f2f3fd1a743e7d34d40 Mon Sep 17 00:00:00 2001 From: lyingbug Date: Fri, 20 Mar 2026 22:53:42 +0000 Subject: [PATCH] fix(frontend): replace v-html with text interpolation in deepThink MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace v-html + DOMPurify sanitization with plain Vue text interpolation ({{ }}) and CSS white-space: pre-wrap for the thinking content display. The thinking content is raw model output that should never be interpreted as HTML. Using v-html here created an unnecessary XSS attack surface — even with DOMPurify, the \n→
replacement happened before sanitization, and future changes to sanitizer config could introduce vulnerabilities. Plain text rendering with pre-wrap: - Eliminates XSS risk entirely (no HTML parsing) - Preserves line breaks natively via CSS - Removes the sanitizeHTML import and safeProcessThinkContent function - Simpler code with identical visual output --- .../src/views/chat/components/deepThink.vue | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/frontend/src/views/chat/components/deepThink.vue b/frontend/src/views/chat/components/deepThink.vue index c9468ae0..80002913 100644 --- a/frontend/src/views/chat/components/deepThink.vue +++ b/frontend/src/views/chat/components/deepThink.vue @@ -19,13 +19,12 @@
-
+
{{ deepSession.thinkContent }}