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
Note: Rocket (> 0.4) is not particularly susceptible to the kinds of attacks described below. This issue tracks being able to do better than the status quo, not merely meeting it. There are no known bugs or deficiencies, security or otherwise, related to the topics described in this issue.
A data limit (#1325) is not a sufficient...limit...to prevent DoS attacks. While it helps mitigates memory-exhaustion based attacks, it does nothing to prevent slow-loris style attacks. On async, this translates to a bunch of idling futures, which in-turn means consuming memory, which takes us to memory-exhaustion.
What we'd really like to do is expose an API that requires limits to be set on several properties, with a hard, indelible limit provided by Rocket. In particular:
read timeouts - how long we we're willing to wait between byte reads
data limits - how many bytes we're willing to read in all, irrespective of time
connection timeouts - how long we're willing to keep the connection open, irrespective of whether data is being received or not.
My take is that an adaptive bandwidth-minimum approach to the connection timeout might actually make a bit more sense, especially when we consider very purposefully long-lived connections. That is, after a chosen period of time, assuming the other timeouts/limits haven't been exceeded, require that the bandwidth over a sliding window of time exceeds some value. Otherwise, kill the connection, ideally in a graceful manner.
This approach seems fairly easy to implement in async. Combined with the API I proposed above, this should significantly decrease the opportunity for DoS based attacks on Rocket applications, and in the common case, make them impossible.
@igalic We can implement the majority of this feature in Rocket itself, but hyperium/hyper#1628 is a pre-requisite for it to meaningfully contribute to Rocket's security and stability.
Note: Rocket (
> 0.4
) is not particularly susceptible to the kinds of attacks described below. This issue tracks being able to do better than the status quo, not merely meeting it. There are no known bugs or deficiencies, security or otherwise, related to the topics described in this issue.A data
limit
(#1325) is not a sufficient...limit...to prevent DoS attacks. While it helps mitigates memory-exhaustion based attacks, it does nothing to prevent slow-loris style attacks. Onasync
, this translates to a bunch of idling futures, which in-turn means consuming memory, which takes us to memory-exhaustion.What we'd really like to do is expose an API that requires limits to be set on several properties, with a hard, indelible limit provided by Rocket. In particular:
My take is that an adaptive bandwidth-minimum approach to the connection timeout might actually make a bit more sense, especially when we consider very purposefully long-lived connections. That is, after a chosen period of time, assuming the other timeouts/limits haven't been exceeded, require that the bandwidth over a sliding window of time exceeds some value. Otherwise, kill the connection, ideally in a graceful manner.
This approach seems fairly easy to implement in
async
. Combined with the API I proposed above, this should significantly decrease the opportunity for DoS based attacks on Rocket applications, and in the common case, make them impossible.This was largely ported over from #990 and #1325.
The text was updated successfully, but these errors were encountered: