ragflow
ragflow copied to clipboard
Implement DOMPurify to sanitize HTML content before rendering
What problem does this PR solve?
This PR resolves issue #1491 related to HTML Injection and Cross-Site Scripting (XSS). The issue was caused by the unsafe usage of dangerouslySetInnerHTML without proper sanitization of user input.
Changes
- Added DOMPurify dependency.
- Updated the following components to use DOMPurify:
web/src/pages/add-knowledge/components/knowledge-chunk/components/chunk-card/index.tsxweb/src/pages/chat/markdown-content/index.tsxweb/src/pages/add-knowledge/components/knowledge-setting/category-panel.tsx
Type of change
- [x] Other (please describe): Security Fix