add warnings about limitations of idle-timeout - #1194
Conversation
mkurz
left a comment
There was a problem hiding this comment.
Findings
-
Medium: the timeout direction is described incorrectly.
The new comment says it triggers when “no data is received.” Pekko uses
bidirectionalIdleTimeout, so traffic in either direction resets it. This should say “when no bytes are sent or received.” Implementation -
Medium: the suggested mitigations could imply stronger protection than they provide.
Lowering
idle-timeoutonly forces an attacker to send bytes more frequently.max-content-lengthlimits entity bytes, but does not impose a receive deadline, protect slowly delivered headers, or help until the entity stream is materialized. Entity-limit semanticsThe comment should explicitly say these settings reduce exposure but do not bound request duration. The reverse-proxy or application-level timeout recommendation from the PR body should be retained.
-
Low: the canonical timeout documentation remains incomplete.
The same limitation should be added to
docs/src/main/paradox/common/timeouts.md, where idle-timeout is documented publicly. That page already correctly describes the timeout as bidirectional. Timeout documentation
Suggested wording:
# This is a bidirectional inactivity timeout. It triggers only when no
# bytes are sent or received for the configured duration. Traffic in
# either direction, including a client sending bytes at intervals shorter
# than the timeout, keeps the connection alive; it is not an overall
# request-receive timeout. Lowering this value and configuring
# pekko.http.server.parsing.max-content-length reduce exposure but do not
# bound request duration. Use an appropriately configured reverse proxy or
# application-level entity timeout when a hard receive deadline is required.Clarified the description of the idle connection timeout to specify it as a bidirectional inactivity timeout and provided additional context on its behavior.
|
Thanks @mkurz - changed as suggested. I'll have a look at docs/src/main/paradox/common/timeouts.md |
Clarify the behavior of the inactivity timeout, including its bidirectional nature and implications for connection management.
The idle-timeout does catch completely idle connections, but an attacker sending one byte per second would keep the connection alive indefinitely since data is flowing. The request timeout only starts after the entity is complete.
The real mitigations users can apply:
Adding a per-entity receive timeout to the framework would be a significant feature.