I'm working on a simple game with an authoritative server. The player can move in 4 directions on a 2D board.
The game samples input at 30hz and sends it to the server. The server also runs at 30hz. One input packet contains basically the current player movement direction (None, Left Right..). When a packet is received, it is buffered and then processed during the next server tick.
It works well, however when a malicious client doubles it's sampling rate, the player speed will double as well and this allows for speed hacking. One solution would be to only process a single update packet every tick. However I am aware that packets do not arrive nicely spaced due to network lag.
Another solution I found is to keep a "allowedInputUpdatePackets" counter for each player and increasing it with every tick. (A Solution from the related question Network jitter, client input to server) This prevents the speedhacking while still allowing for some network jitter. But now the client can just stop sending packets, and after a while send multiple at once, resulting in a teleportation. (well almost) I can limit the maximum number of input updates per tick to e.g. 3-5 but this still allows the players to have a small speed boost every time they start moving.
I don't really see a solution to this problem. How to deal with malicious clients sending multiple input packets?