Nextcloud · Report #2211561
Self XSS when pasting HTML into Text app with Ctrl+Shift+V
Validstatus
mediumseverity
20upvotes
21 Dec 2023disclosed
Summary
Security advisory at https://github.com/nextcloud/security-advisories/security/advisories/GHSA-p7g9-x25m-4h87
How it was found
Summary:
ctrl-shift-v is meant to paste plaintext as is. However it will paste it into a dom elements innerHtml and can thus be used to inject malicious html.
Steps To Reproduce:
- copy "<h1>html</h1>"
- use ctrl-shift-v to paste it into a .md file
- See the heading getting added.
Supporting Material/References:
https://github.com/nextcloud/text/blob/main/src/extensions/Markdown.js#L97
- [attachment / reference]
Impact
If you can trick someone into using ctrl-shift-v to paste content you control you can insert html into the page leading to a possible xss attack.
The html will be inserted into the editors schema - but before that happens it's already pasted into the innerHtml of a dom element.