Replies: 1 comment
-
Hi! Yes, I'd say that counts as a regular DOS attack. You could catch the 'ping' messages in your application and close the connection: function listenToPing(socket) {
socket.on("ping", () => {
console.warn("unexpected ping");
socket.close();
});
}
io.engine.on("connection", (engineSocket) => {
if (engineSocket.transport.name === "websocket") {
listenToPing(engineSocket.transport.socket);
} else {
engineSocket.on("upgrade", (transport) => {
if (transport.name === "websocket") {
listenToPing(transport.socket);
}
})
}
}); I'm wondering whether we should include it in the library, as receiving |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey, my & a few other websites has been hit by the following attack over the last few days. We've managed to retrieve the PoC from the person doing the attack & it's basically a ping flooding attack.
What's happening?
The attacker is using a pretty simple but effective method:
After a little bit, the WS server just dies. The obvious solution seems to be rate limiting pings per IP address, but that wasn't as straight forward as I had hoped (because the events for pings are not emitted in the same way as other pings).
Is this considered a socket.io vulnerability? Or is this considered a regular DOS attack?
What's the "correct" way to mitigate this?
The PoC we retrieved from the attacker:
Beta Was this translation helpful? Give feedback.
All reactions