I have read the thread about CSRF attacks in websockets (Do WebSocket-powered web apps (e.g. "comet" apps) have to worry about CSRF?) and also some more material regarding websocket security, but none of them seem to address the following issue -
Is it possible for an attacker to cause (by luring the victim to press a link) a legitimate user to open a WebSocket towards the legitimate service and/or cause the victim to send messages crafted by an attacker within the victim's existing WebSocket? (similar to a standard CSRF attack in the context of HTTP).
If possible, what can be done to prevent it? Is sending a token in the WebSocket URL during the WebSocket opening enough, or does the token need to be sent within each and every one of the requests sent within the WebSocket?
We are intending to use WebSockets to implement a chat in the unauthenticated area of our site, and we want to make sure we are doing everything possible to prevent malicious users from executing attacks similar to the one described above. Any special recommendations regarding the most secure way to implement this?