Files
inbuxa-server/crates/http-proto
jcoffey-dev e85ea6a360 HTTP: a client that stops sending its body or reading its answer is dropped
The HTTP listener timed only the request head (hyper's 30 seconds).
Once a request declared a body, nothing timed reading it, and nothing
timed writing the answer. A client that sent "POST /api/x" with a
Content-Length and then nothing, or pipelined requests and never read
the answers, held its connection for as long as the TCP connection
lived, at no cost in rate limit or fail2ban. Every listener allows
8,192 connections, so one unauthenticated address could fill them all
and lock everyone out of JMAP, WebDAV, OAuth sign-in, autoconfig and
the admin API until it let go.

Now a request body that sends nothing for 60 seconds is given up, and
the request fails. A write to the client that makes no progress for 60
seconds ends the connection. Both count from the last progress, so a
slow upload or download that keeps moving, an event stream and an idle
WebSocket are not affected.

Found in a security review.

Test: in crates/http, over a connection served as the listener serves
it, a POST that declared 1,000,000 body bytes and sent 3 got no answer
after 120 seconds, and a client that never read a 1 MiB answer kept its
connection after 120 seconds. Now the first gets 408 from the test's
handler and the second connection ends with an error, both within the
120 seconds.
2026-11-17 21:36:20 -07:00
..