#63 serve: unbounded thread-per-connection + 500ms ack sleep = trivial availability DoS

closedsecurityopened
details
updated
id
476e0fbb-25b5-4051-92ae-8e38a1fef02e

hu13 serve is thread-per-connection with no cap, and every inbox response sleeps 500 ms.

Verified:

before: 1 thread
$ python3 open 300 idle sockets sending "GET / HTTP/1.1\r\nHost: x\r\n" (no terminator)
during: 301 threads   VmRSS 11.8 MB

Those sockets cost nothing per connection and can be kept alive indefinitely (a byte every < read timeout). ~10-30k cheap sockets exhaust the thread/pid limit or memory, and the server stops accepting.

Amplifiers:

Related, same class but separate resource: #63 (git upload-pack with no timeout/cap).

Fix direction:

Acceptance:

Comments (2)

all issues