Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anyone can spam easily by using the exposed io() function #2211

Closed
ClassicOldSong opened this issue Aug 17, 2015 · 5 comments
Closed

Anyone can spam easily by using the exposed io() function #2211

ClassicOldSong opened this issue Aug 17, 2015 · 5 comments

Comments

@ClassicOldSong
Copy link

Once linked to the socket anyone can use a simple script to start spamming just by running this in your browser's console:
for (i=1; i<1000; i++) { io().emit("new message", i.toString());};

new message can be replaced with any event that the server can responce, such as I can easily make the onlinecount to a great number:
image

I hope you can find a solution to solve this problem.

@ClassicOldSong
Copy link
Author

Found solution: pass io() into a closure and then use window.io = null; to neutralize the global io() function

@3rd-Eden
Copy link
Contributor

That doesn't solve the problem as you only hide io constructor. Everybody can still create thousands of connections using any other library them choose to import or just through the CLI. But this is hardly a Socket.IO issue as you should take care of rate limiting and DDOS protection your self.

@ClassicOldSong
Copy link
Author

Yeah but the demo chatroom can just use this method to flood.

@shawn-simon
Copy link

welcome to the internet @ClassicOldSong

@darrachequesne
Copy link
Member

That issue was closed automatically. Please check if your issue is fixed with the latest release, and reopen if needed (with a fiddle reproducing the issue if possible).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@3rd-Eden @shawn-simon @ClassicOldSong @darrachequesne and others