-
Notifications
You must be signed in to change notification settings - Fork 143
Description
Vulnerability
RichText renders untrusted HTML using dangerouslySetInnerHTML and iframe srcDoc without sanitization.
Affected file:
- general-editor/src/tags/object/RichText/view.js
Impact
Stored/reflected XSS in annotation content can execute arbitrary JS in another users browser (token theft, actions as victim).
Steps to Reproduce
- Render a value containing one of:
<img src=x onerror=alert('XSS')>
or
<svg onload=alert('XSS')> - The alert fires on render.
PoC
Any payload above in item._value triggers execution on render.
Expected vs Actual
Expected: HTML sanitized; no script execution.
Actual: Script executes.
Working Patch
Public gist (single-commit patch): https://gist.github.com/ashutoshkumarsingh-dev/49880549b5786b43e39e4954a59d74d5
Apply with:
�ash git am -3 < fix-general-editor-xss-sanitize.patch
Files in patch:
- general-editor/src/tags/object/RichText/view.js: sanitize value with DOMPurify; use sanitizedVal for dangerouslySetInnerHTML and iframe srcDoc
- general-editor/package.json: add dompurify dependency
CVSS v3.1
AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N = 6.1 (Medium)
Notes
I can submit a PR as well; I couldnt fork the public repo due to access. The patch is complete and ready to apply.