Fix: XSS vulnerability in Ragflow's chat view (#10519)

### What problem does this PR solve?

Fix: XSS vulnerability in Ragflow's chat view

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu
2025-10-13 19:04:25 +08:00
committed by GitHub
parent ff4239c7cf
commit 8c75803b70
3 changed files with 6 additions and 6 deletions

View File

@ -54,8 +54,8 @@ function MarkdownContent({
const { setDocumentIds, data: fileThumbnails } = const { setDocumentIds, data: fileThumbnails } =
useFetchDocumentThumbnailsByIds(); useFetchDocumentThumbnailsByIds();
const contentWithCursor = useMemo(() => { const contentWithCursor = useMemo(() => {
// let text = DOMPurify.sanitize(content); let text = DOMPurify.sanitize(content);
let text = content; // let text = content;
if (text === '') { if (text === '') {
text = t('chat.searching'); text = t('chat.searching');
} }

View File

@ -48,8 +48,8 @@ const MarkdownContent = ({
const { setDocumentIds, data: fileThumbnails } = const { setDocumentIds, data: fileThumbnails } =
useFetchDocumentThumbnailsByIds(); useFetchDocumentThumbnailsByIds();
const contentWithCursor = useMemo(() => { const contentWithCursor = useMemo(() => {
// let text = DOMPurify.sanitize(content); let text = DOMPurify.sanitize(content);
let text = content; // let text = content;
if (text === '') { if (text === '') {
text = t('chat.searching'); text = t('chat.searching');
} }

View File

@ -64,8 +64,8 @@ const MarkdownContent = ({
const { setDocumentIds, data: fileThumbnails } = const { setDocumentIds, data: fileThumbnails } =
useFetchDocumentThumbnailsByIds(); useFetchDocumentThumbnailsByIds();
const contentWithCursor = useMemo(() => { const contentWithCursor = useMemo(() => {
// let text = DOMPurify.sanitize(content); let text = DOMPurify.sanitize(content);
let text = content; // let text = content;
if (text === '') { if (text === '') {
text = t('chat.searching'); text = t('chat.searching');
} }