Repository navigation
fix: user-setting modal fixes and DOMPurify cleanup - #16449
Conversation
- HighlightMarkdown: drop post-process DOMPurify pass (ineffective after preprocessLaTeX; Coderabbit CRITICAL #3486038798) - SettingTeam: add invite-only-registered-users hint to add-user modal - SettingModel: reset provider loading state when add-provider modal closes - MCP edit dialog: set maskClosable=false to prevent accidental dismissal - Form: switch FormDescription color from text-muted-foreground to text-text-disabled
📝 WalkthroughWalkthroughSeveral small fixes across the web UI: DOMPurify sanitization removed from ChangesUser Settings UI Fixes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
web/src/components/highlight-markdown/index.tsx (1)
32-32: 🔒 Security & Privacy | 🔴 Critical | ⚡ Quick winRestore sanitization after
preprocessLaTeXbefore rendering raw HTML.
preprocessLaTeX()can turn entity-encoded payloads back into real tags, andrehypeRawwill parse them at render time. The current path passesprocessedstraight intoMarkdown, so<script>/onerrorcontent can reach the DOM; the tests here already expect that to be stripped.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/src/components/highlight-markdown/index.tsx` at line 32, The highlighted markdown flow currently preprocesses input with preprocessLaTeX and then sends processed directly into Markdown, which can reintroduce real HTML tags before rehypeRaw renders them. Update the HighlightMarkdown component to sanitize the processed content again before rendering, using the existing sanitization path or equivalent safe filtering, so any script tags or event-handler attributes introduced by preprocessLaTeX are stripped before Markdown receives the string.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@web/src/components/ui/form.tsx`:
- Line 152: The requested change should not be made inside FormDescription in
src/components/ui/form.tsx because that directory is restricted. Move the
styling adjustment into a new wrapper/adapter component outside
src/components/ui/ and have it compose the existing FormDescription from the ui
module. Use a clear symbol name like FormDescriptionWrapper (or similar) in a
feature/shared components folder so callers can import the wrapper without
altering the base ui component.
---
Outside diff comments:
In `@web/src/components/highlight-markdown/index.tsx`:
- Line 32: The highlighted markdown flow currently preprocesses input with
preprocessLaTeX and then sends processed directly into Markdown, which can
reintroduce real HTML tags before rehypeRaw renders them. Update the
HighlightMarkdown component to sanitize the processed content again before
rendering, using the existing sanitization path or equivalent safe filtering, so
any script tags or event-handler attributes introduced by preprocessLaTeX are
stripped before Markdown receives the string.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: eaec4d42-61e5-47bc-abc0-16d3d7e32b67
📒 Files selected for processing (7)
web/src/components/highlight-markdown/index.tsxweb/src/components/ui/form.tsxweb/src/locales/en.tsweb/src/locales/zh.tsweb/src/pages/user-setting/mcp/edit-mcp-dialog.tsxweb/src/pages/user-setting/setting-model/index.tsxweb/src/pages/user-setting/setting-team/add-user-modal.tsx
Summary
fix: user-setting modal fixes and DOMPurify cleanup
#3486038798)