Skip to content

Conversation

@arjanchaudharyy
Copy link
Contributor

Issue
When rendering markdown content in the
MarkdownView
component, user-provided content was being inserted directly into the DOM using dangerouslySetInnerHTML without sanitization. This created a Stored XSS vulnerability where attackers could inject malicious scripts that execute when other users view the content.

Attack Vectors:

Script tag injection: <script>stealCookies()</script>
Event handler injection:
JavaScript URL injection: link
Malicious iframe embedding from untrusted domains

Solution
Integrated DOMPurify (v3.2.4) for robust HTML sanitization before rendering
Implemented strict allowlist of safe HTML tags and attributes
Added custom hooks to validate iframe sources against trusted domains (YouTube, Vimeo only)
Added custom hooks to block javascript:, vbscript:, and data: URLs
Added comprehensive security test suite with 25+ test cases

@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@arjanchaudharyy arjanchaudharyy force-pushed the security-fix branch 6 times, most recently from 813d9f2 to 9855c2c Compare February 3, 2026 15:11
Signed-off-by: arjanchaudharyy <arjanchaudharyy@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant