decent-chat / decent

Open source messaging platform for the modern web
https://meta.decent.chat
GNU General Public License v3.0
21 stars 5 forks source link

[SECURITY] XSS in markdown parser for images #282

Closed joker314 closed 6 years ago

joker314 commented 6 years ago

This is a security issue.

Proof of concept

1) Enter a server 2) Type the following payload as a message

![Click me please](javascript:alert``)

3) Click the broken image 4) Observe a pop-up box which proves that an XSS issue exists

This issue does not happen with links, so it's an oversight that no filtering occurs when linking images to their URLs.

Remediation

Do whatever you do when someone posts

[Click me](javascript:alert``)

Because somehow that doesn't cause an XSS.

Impact

This is an important security issue as it compromises the security of this client. JavaScript from the payload has access to localStorage and so can do bad things.