fix: security vulnerabilities - command injection and XSS#11084
Open
continue[bot] wants to merge 2 commits intomainfrom
Open
fix: security vulnerabilities - command injection and XSS#11084continue[bot] wants to merge 2 commits intomainfrom
continue[bot] wants to merge 2 commits intomainfrom
Conversation
- core/util/tts.ts: Enhanced sanitizeMessageForTTS to remove single quotes and newlines to prevent shell command injection attacks - gui/src/components/StyledMarkdownPreview/MermaidBlock.tsx: Sanitize Mermaid SVG output with DOMPurify before rendering to prevent XSS - gui/src/pages/config/sections/ToolsSection.tsx: Sanitize info HTML with DOMPurify before dangerouslySetInnerHTML to prevent XSS Generated with [Continue](https://continue.dev) Co-Authored-By: Continue <noreply@continue.dev> Co-authored-by: bekah-hawrot-weigel <bekah@continue.dev>
Contributor
Author
Docs ReviewNo documentation updates needed for this PR. Reason: This PR contains internal security hardening (command injection prevention in TTS, XSS prevention in Mermaid and MCP server info rendering) that:
Security implementation details like input sanitization are internal safeguards that don't require documentation, as they're transparent to users. |
- Consolidate multiple .replace() calls into a single regex pattern - Remove dead code: single quote escaping in Windows is no longer needed since quotes are now removed during sanitization Generated with [Continue](https://continue.dev) Co-Authored-By: Continue <noreply@continue.dev> Co-authored-by: bekah-hawrot-weigel <bekah@continue.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes 3 security vulnerabilities identified through security analysis:
Issues Fixed
core/util/tts.tsgui/src/components/StyledMarkdownPreview/MermaidBlock.tsxgui/src/pages/config/sections/ToolsSection.tsxChanges
core/util/tts.ts: EnhancedsanitizeMessageForTTSfunction to:gui/src/components/StyledMarkdownPreview/MermaidBlock.tsx: Added DOMPurify sanitization of Mermaid-rendered SVG before setting innerHTML, using SVG-specific profile.gui/src/pages/config/sections/ToolsSection.tsx: Added DOMPurify sanitization of server info HTML before using dangerouslySetInnerHTML.Testing
Generated with Continue
Co-Authored-By: Continue noreply@continue.dev
Co-authored-by: bekah-hawrot-weigel bekah@continue.dev
Continue Tasks: ✅ 7 no changes — View all
Summary by cubic
Fixes a command injection bug in TTS and two XSS vectors in the GUI by sanitizing inputs and SVG output. Refactors TTS sanitization into a single regex and removes Windows-specific escaping, with no user-facing changes.
Written for commit 9e1ea3d. Summary will update on new commits.