You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.
I just noticed that it is possible to inject HTML and JS (and possible everything) sending a message to a friend. I.E.
Hi friend, a cool <a href="javascript:alert('Bad things could happen')">link</a> to you!
I think we need to process text after decryption and before to show, because there is no way to avoid a bad actor to encrypt a bad code. The server also can not process the messages because they are encrypted.
We can use safe_text = insecure_text.replace(/</g, "< ;").replace(/>/g, "> ;"); (removing space before ";"
The text was updated successfully, but these errors were encountered:
To solve this once for all I decided to add Content-Security-Policy header, not allowing inline scripts. This jQuery solution ( .text(msg) ) was applied to all times that usernames or messages are displayed, solving html injections and possibility to destroy the site layout.
Hi Mark!
I just noticed that it is possible to inject HTML and JS (and possible everything) sending a message to a friend. I.E.
Hi friend, a cool <a href="javascript:alert('Bad things could happen')">link</a> to you!
I think we need to process text after decryption and before to show, because there is no way to avoid a bad actor to encrypt a bad code. The server also can not process the messages because they are encrypted.
We can use safe_text = insecure_text.replace(/</g, "< ;").replace(/>/g, "> ;"); (removing space before ";"
The text was updated successfully, but these errors were encountered: