]> git.kaiwu.me - nginx.git/commit
Mail: fixed use-after-free on client reset during auth_http request
authorVadim Zhestikov <v.zhestikov@f5.com>
Wed, 4 Nov 2026 17:54:11 +0000 (09:54 -0800)
committerSergey Kandaurov <pluknet@nginx.com>
Wed, 11 Nov 2026 18:08:26 +0000 (22:08 +0400)
commitdf9d8d940ecb83a50b1e55ccc296d0a29cfe774c
tree5b5a8b466f23a88f58350edf57bfbf0fdc156279
parent9e811a43119ac902f0d0296fb4afb34bb063cf1b
Mail: fixed use-after-free on client reset during auth_http request

When a client command starts an auth_http request, the default reply
set by the POP3, IMAP and SMTP auth state handlers remains in s->out,
though it is never used: the actual reply depends on the auth_http
response.  With ngx_mail_send() as the client write handler, the reply
could be sent before the authentication result was known, and if the
client reset the connection, the failed send destroyed the session
while the auth_http connection still referenced it.

The queued reply is now discarded when the auth_http request starts,
similarly to ngx_mail_proxy_init().

Reported by Xint.io.
src/mail/ngx_mail_auth_http_module.c