Topic: Patching current vulnerabilities and moving on to 0.7.0
Split topic from here. // Dune
There is a patch available here https://github.com/axblk/teeworlds/tree/0.6-improved
With this commit patching the vulnerability https://github.com/axblk/teeworlds/comm … b8d92cd1ac
(I think it was merged from ddnet)
The commit you've linked to only limits how many player lists are send out per second (to clients looking for servers), but AFAIK that not the main problem right now.
The attacker appears to be using that it is possible to occupy slots without ever receiving and responding to a reply from the server. Right now taking up a slot is as easy as sending one UDP packet with the right content to the server. This leads to the many "(connecting)" clients that clog the servers. I tested it offline, trying to replicate the attack.
Stopping the attack might be possible by blacklisting the IPs that try to connect too often over and over a long period of time, but if the attackers ISP lets them forge their source IP address, they can make up as many addresses as they want (but only for sending, not receiving). In that case it is necessary add some kind of token to the protocol. Unfortunately that needs changes in both the server and the client. Maybe it is possible to improvise by putting a token (generated specifically for each player) in the server name and having them use it as a password. Unfortunately right now players already take up a slot when they are looking at the password prompt and the slot number appears to double as the player id (Not quite sure, don't quote me on that) making this a difficult to implement.
I did not have a server running before the attack started and the attacker does not appear to refresh their sever list so this is mostly guesswork.
Another idea to at least make the attack more difficult is to modify the server to not refuse new clients when the server is full of "clients" that aren't fully connected and instead randomly drop one of the other clients. This way the attacker can not block the server completely, just reduce the probability of a successful connection. Of course that's a rather dirty solution but at least it's very easy to implement. Here (https://pastebin.com/4Bj8mPnt) is a patch doing exactly that, but I wouldn't advice anyone to use it because it is barely tested, still has some printline debugging in it and is easy to circumvent for the attacker. At least it works against my test attack script.