-
Notifications
You must be signed in to change notification settings - Fork 435
Open
Description
Security Issue: Potential XSS in HTML Rendering
Severity: HIGH → FIXED ✅
Location: Multiple files with dangerouslySetInnerHTML
Description
Multiple components used dangerouslySetInnerHTML without sanitization, creating potential XSS vulnerabilities.
Status
✅ RESOLVED - Added DOMPurify sanitization
Files Updated
src/renderer/features/ui/agent-tool-call.tsx- subtitle HTMLsrc/renderer/features/ui/agent-edit-tool.tsx- syntax highlighted codesrc/renderer/components/chat-markdown-renderer.tsx- code block HTML
Changes Made
- Installed
dompurifyand@types/dompurify - Added
DOMPurify.sanitize()to alldangerouslySetInnerHTMLusages - HTML now sanitized before rendering
Code Example
// Before
dangerouslySetInnerHTML={{ __html: htmlContent }}
// After
dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(htmlContent) }}Defense in Depth
While the HTML comes from trusted Shiki library, DOMPurify provides additional security layer in case:
- Shiki library is compromised
- User-generated content reaches rendering path
- Future code changes introduce vulnerabilities
This issue can be closed as resolved.
Labels: security, fixed, xss
Metadata
Metadata
Assignees
Labels
No labels