Cap pre-join plugin-message queue size (prevents arbitrary growth/OOM)#1800
Cap pre-join plugin-message queue size (prevents arbitrary growth/OOM)#1800WouterGritter wants to merge 1 commit into
Conversation
|
Depending on how long a client is actually able to stall the login phase for, this may be a scary OOM once again.
Of course this PR fixes that, and I'm sorry to keep bumping this but, #1786 would have greatly crippled this attack. At a limit of 5MB/s of decompressed packets per second, it would take around half an hour to fill the same 10GB in this queue. Still an OOM, if the client is actually able to stall the login phase for 30 minutes, but way less instant. |
A client that stalls its FML/login handshake could enqueue plugin messages (each up to ~32 KiB serverbound) without bound in
ClientPlaySessionHandler#loginPluginMessages, growing per-connection heap until an OOM kill. This PR caps the queue by both bytes (4 MiB) and count (1024), configurable viavelocity.max-queued-login-plugin-message-bytesandvelocity.max-queued-login-plugin-messages, and disconnects on overflow.