Files
jcoffey-dev 739a7c1605 IMAP and ManageSieve: hold requests before sign-in to 64 KiB
Before a client signed in, IMAP and ManageSieve accepted requests and
literals up to the full configured request size (50 MB by default), and
reserved room for a literal as soon as its size was announced. Each
argument was also copied when it was handed on, and the grown buffer
was kept for the rest of the session, so a large literal cost twice its
size and stayed allocated. Anyone who could connect could make the
server hold about 100 MB per connection without signing in.

Requests before sign-in are now limited to 64 KiB, which is more than
any login, SASL response or bearer token needs. The configured size
applies once the client has signed in, and stops applying again after
UNAUTHENTICATE. Arguments are handed over without a copy, and a
literal's buffer is sized to the literal.

Test: AUTHENTICATE PLAIN {100000} before sign-in got "+ Ready for
100000 bytes." on main and now gets BAD; a receiver unit test that
found a 2 MB buffer kept after a 1 MB literal now passes.
2026-10-28 17:06:32 -07:00
..