From: Vadim Zhestikov Date: Wed, 28 Oct 2026 15:55:50 +0000 (-0700) Subject: Mail: disabled handling of headers without a colon in auth_http X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=297861bf6cdf2d3ebeddce860059ddaa20a050b2;p=nginx.git Mail: disabled handling of headers without a colon in auth_http Header names not followed by a colon and a value in an auth_http server response were accepted as headers with an empty value, similarly to ngx_http_parse_header_line(). With this change, such headers are rejected with the "sent invalid header in response" error, and the client gets the internal server error reply. The problem appeared in 5192b3651 (0.1.38). --- diff --git a/src/mail/ngx_mail_auth_http_module.c b/src/mail/ngx_mail_auth_http_module.c index 3e5095a2d..1b077a469 100644 --- a/src/mail/ngx_mail_auth_http_module.c +++ b/src/mail/ngx_mail_auth_http_module.c @@ -985,21 +985,6 @@ ngx_mail_auth_http_parse_header_line(ngx_mail_session_t *s, break; } - if (ch == CR) { - ctx->header_name_end = p; - ctx->header_start = p; - ctx->header_end = p; - state = sw_almost_done; - break; - } - - if (ch == LF) { - ctx->header_name_end = p; - ctx->header_start = p; - ctx->header_end = p; - goto done; - } - return NGX_ERROR; /* space* before header value */