You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RSocket server is subject to frames flood for non-existent streams #898
RSocket server indefinitely accepts PAYLOAD frames of non-existent (terminated) streams. This can be abused by rogue clients to degrade server's responsiveness and increase operational costs.
Local testing with single client continuously sending 1k bytes frames over 1000 mbit connection showed that generated traffic consumed up to 10% (server process) of 12 vCPU box.
Issue is similar to [1], except that payload frames of up to 16 MBytes (RSocket frame size limit) can be used.
I see a possible improvements in ClientServerMultiplexer so we can get rid of few volatile read/writes.
But my belief is that a user should put an interceptor to track such attack and protect against it and rsocket implementation should not bring any assumptions on how to detect such an attack.
As an improvement, we can consider exposing existing streams in readonly mode, to let interceptor do track of existing streams and detect frames for non-existing. The same tracking can be done independently though, so in such case an interceptor would have to mimic the same as internals in RSocket do (which is not a big deal for plugins vendor)
I will try to play around to see if one can protect agains it without touching internals
@mostroverkhov do you have any suggestions for what we can do? From the perspective of RSocket Java, such frames are dropped and probably couldn't be dropped much earlier to make a substantial difference. Any other solution requires keeping track of how many frames have been received for non-existent streams and choosing a threshold will be difficult without more knowledge of the application.
Activity
OlegDokuka commentedon Jul 30, 2020
I see a possible improvements in
ClientServerMultiplexerso we can get rid of fewvolatileread/writes.But my belief is that a user should put an interceptor to track such attack and protect against it and rsocket implementation should not bring any assumptions on how to detect such an attack.
As an improvement, we can consider exposing existing streams in readonly mode, to let interceptor do track of existing streams and detect frames for non-existing. The same tracking can be done independently though, so in such case an interceptor would have to mimic the same as internals in RSocket do (which is not a big deal for plugins vendor)
I will try to play around to see if one can protect agains it without touching internals
rstoyanchev commentedon Aug 3, 2020
@mostroverkhov do you have any suggestions for what we can do? From the perspective of RSocket Java, such frames are dropped and probably couldn't be dropped much earlier to make a substantial difference. Any other solution requires keeping track of how many frames have been received for non-existent streams and choosing a threshold will be difficult without more knowledge of the application.