I am making a bookmarklet so that a user can cross domain post to my server using CORS from any page. The user has to authenticate before posting and cookies are used. Is there any way to prevent a malicious website from imbedding javascript code in their webpage to do cross domain post to my server using the user's credential?
In theory, there may be a solution for this.
There is one flaw with this concept: if a website tampers with any of the functions used by the bookmarklet (such as Array()
), the malicious website may still be able to intercept, copy and / or modify the message, userID or CSRF token.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With