-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request collector stores arbitrary Monitoring Requests #419
Comments
We must accept MonitoringRequests before those channels are confirmed. This makes it hard to just discard MRs in case of a DOS attack without complicating the request collector a lot. I suggest a combination of
|
Well that's a bit of a circular problem. Matrix has server side rate limiting support. But how would an attacker generate arbitrary amounts of requests? Based on that it should be possible to implement some per-channel-peer rate limiting yourselves, shouldn't it? |
I'm not really familiar with the client code base, but before a transfer happens there seems to be done this check in the channel which relies on this check in the token_network view. |
Also regarding rate limiting or other checks performed in matrix: I think it's good practice to think of a module as an autonomous security perimeter. |
We tried that in the beginning, but it might happen that a message is send before the services receive the event. Currently we use the same number of confirmation blocks as the client, but we still run into these cases, so for example #423 , which happened today in a scenario run)
That makes sense. |
Correct me if I get this wrong, but this seems to be mostly a issue for tests, as in production a RequestMonitoring would be send only after a balance proof was received, which would only happen for a open, confirmed channel. If this is correct, another approach would be to make the chain-event related sanitization of the Requests configurable and switch them off or mock them for tests. |
The number of confirmed blocks between client and MS might be different. But even if they are the same and block propagation is a bit slower for the eth node of the MS, we can easily run into that scenario. |
So would using a strictly smaller number of blocks for confirmation in the MS work? |
This would increase the chance that the CannelOpened event arrives in time by a lot. Depending on how strict we want to be, that might be sufficient. But it would be nice if clients and services could choose their number of confirmed block independently. Also the current approach allows the request collector to be very simple and not have any connection to the blockchain at all. We would lose that simplicity if we checked the MR's channel before saving them. |
If you don't won't to the request collector to depend on events, you can use the MS for that, e.g. provide an internal api to query for events the MS for seen events. Or simply "misuse" the db a little, store channel_identifiers to the db once the MS sees an event, s.t. the request collector can see that the channel actually exists. But in general it's the services team's call to make if or how to implement a mitigation, just let me know if I can assist. |
I wanted to use a pre-built rate limiter, but none really fit well for this use case. Should be a sufficient mitigation to close raiden-network#419.
An attacker can send an arbitrary amount of MonitoringRequests to the request collector, which will - given matching chain id - store it to the shared db. This allows cheap denial of service attacks against the shared database, the request collector and the monitoring service.
The text was updated successfully, but these errors were encountered: