Empty UDP packets cause server crash
On the windows 10 BDS (this may effect other versions too) a crash can happen when a large amount of empty UDP packets hit the server.
The log "ATTENTION! Received EMPTY UDP packet - potential UDP ports scanning." will happen every time an empty UDP packet is sent. This can be exploited to crash the server by just throwing large amounts of empty packets at the server.
Details:
The Log message is sent via a printf call which is considered unsafe in the moder world.
My guess is to why this happens is that it takes a while to print in general, The packet thread is paused while this happens and a race condition.
The location of the call is in RakNetSocket2.cpp in the deps tree of the MCBE codebase (this effects normal clients afaik).
The function is "RakNet::RNS2_Berkley::RecvFromLoopInt". Only know this due to symbols being in the BDS. So reporting on these bugs may become harder
Fix:
To fix this all you have to do is remove this log and it drastically helps. This cant be fully fixed like that but it drops the performance tank that happens when this attack happens.
Recreation:
A simple test is start a BDS instance and make a simple script/app to send as many UDP packets as you can to the server and it should crash quite quickly
Showcase:
I will attach below a video of it working and the script used to perform it
Environment
Windows Version 10.0.19045 Build 19045
Linked Issues
Attachments2
Comments2
History16
Changed description:
On the windows 10 BDS (this may effect other versions too) a crash can happen when a large amount of empty UDP packets hit the server.
0The log "ATTENTION! Received EMPTY UDP packet - potential UDP ports scanning." will happen every time an empty UDP packet is sent. This can be exploited to crash the server by just throwing large amounts of empty packets at the server.
00
Details:
0The Log message is sent via a printf call which is considered unsafe in the moder world.
0My guess is to why this happens is that it takes a while to print in general, The packet thread is paused while this happens and a race condition.
0The location of the call is in RakNetSocket2.cpp in the deps tree of the MCBE codebase (this effects normal clients afaik)
0Fix:
0To fix this all you have to do is remove this log and it drastically helps. This cant be fully fixed like that but it drops the performance tank that happens when this attack happens
Recreation:
A simple test is start a BDS instance and make a simple script/app to send as many UDP packets as you can to the server and it should crash quite quickly
Added attachment:
Added attachment:
Changed description:
On the windows 10 BDS (this may effect other versions too) a crash can happen when a large amount of empty UDP packets hit the server.
0The log "ATTENTION! Received EMPTY UDP packet - potential UDP ports scanning." will happen every time an empty UDP packet is sent. This can be exploited to crash the server by just throwing large amounts of empty packets at the server.
00
Details:
0The Log message is sent via a printf call which is considered unsafe in the moder world.
0My guess is to why this happens is that it takes a while to print in general, The packet thread is paused while this happens and a race condition.
0The location of the call is in RakNetSocket2.cpp in the deps tree of the MCBE codebase (this effects normal clients afaik)
0Fix:
0To fix this all you have to do is remove this log and it drastically helps. This cant be fully fixed like that but it drops the performance tank that happens when this attack happens.
00
Recreation:
0A simple test is start a BDS instance and make a simple script/app to send as many UDP packets as you can to the server and it should crash quite quickly
Showcase:
Added Security Level: Minecraft - Private
Changed description:
On the windows 10 BDS (this may effect other versions too) a crash can happen when a large amount of empty UDP packets hit the server.
0The log "ATTENTION! Received EMPTY UDP packet - potential UDP ports scanning." will happen every time an empty UDP packet is sent. This can be exploited to crash the server by just throwing large amounts of empty packets at the server.
00
Details:
0The Log message is sent via a printf call which is considered unsafe in the moder world.
0My guess is to why this happens is that it takes a while to print in general, The packet thread is paused while this happens and a race condition.
0The location of the call is in RakNetSocket2.cpp in the deps tree of the MCBE codebase (this effects normal clients afaik)
The function is "RakNet::RNS2_Berkley::RecvFromLoopInt". Only know this due to symbols being in the BDS. So reporting on these bugs may become harder
Fix:
0To fix this all you have to do is remove this log and it drastically helps. This cant be fully fixed like that but it drops the performance tank that happens when this attack happens.
00
Recreation:
0A simple test is start a BDS instance and make a simple script/app to send as many UDP packets as you can to the server and it should crash quite quickly
00
Showcase:
0I will attach below a video of it working and the script used to perform it
Confirmation Status: Unconfirmed → Plausible
Added is duplicated by link: BDS-19350Freezing BDSDuplicate
Confirmation Status: Plausible → Community Consensus
Changed summary:
Added is duplicated by link: BDS-19421Remove printf in RakNet::RNS2_Berkley::RecvFromLoopIntDuplicate
Added affects versions: 1.21.1
Resolution: Unresolved → Fixed
Added affects versions: 1.21.20
MEQS_KEEP_PRIVATE
Plausible due to explanation of the issue