-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Potential XSS vulnerability in link extension #3673
Comments
I think this is related to #2169 which includes a more lengthy discussion about this topic. I'll keep this open for discussion and to keep track of what we want to do here. |
Update: Apparently, TipTap treats JSON and HTML content differently:
This is particularly concerning, as the TipTap security documentation explicitly states "There is no reason to use one or the other [format] because of security concerns". Either the documentation should be updated and clearly point out to the different treatment of JSON and HTML or the sanitization suggestions in #2169 should be implemented as default behavior. |
This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days |
any updates on this? |
It seems to have already been resolved here: #4602 |
I'm probably not aware of every method of inserting XSS into I also tried this approach, which doesn't obviously include the word https://codesandbox.io/p/sandbox/unruffled-napier-9k5ns3 That said, the maintainers should give this another look before this issue is closed. |
Yes but no... ;-) The sanitization of the protocol seems to be done case sensitively when the output is JSON. Consequently, on the sandbox proposed in the original message, changing "javascript:alert(1)" to "Javascript:alert(1)" still allows the XSS attack to succeed... Fun fact: if the format is HTML instead of JSON, the sanitization works whether the "javascript:" is in lower case or not. |
What’s the bug you are facing?
It is possible to execute JavaScript from the "href" attribute of a link.
Which browser was this experienced in? Are any special extensions installed?
Chrome 109.0.5414.119
Firefox 109.0
Safari 16.2
Edge 109.0.1518.70
How can we reproduce the bug on our side?
Can you provide a CodeSandbox?
Yes. See "How can we reproduce the bug on our side?".
What did you expect to happen?
Ideally, the editor would validate / sanitize the href attribute before rendering.
Anything to add? (optional)
Currently, the JSON content representation of the editor must be validated / sanitized separately in order to clear it from any malicious JavaScript. While this should be could practice anyways, the editor should perform such a sanitization by itself, too, as a safety measure.
Did you update your dependencies?
Are you sponsoring us?
The text was updated successfully, but these errors were encountered: