Skip to content

RSocket server is subject to frames flood for non-existent streams #898

Closed

Description

@mostroverkhov

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.

Activity

  1. OlegDokuka commented on Jul 30, 2020

    @OlegDokuka
    Member

    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

  2. rstoyanchev commented on Aug 3, 2020

    @rstoyanchev
    Contributor

    @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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions