From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Subject: [PATCH] Fix CVE-2026-33603 Upstream commits: login-common: Only accept base64 in sasl Taken from the Debian bookworm security update (dovecot 1:2.3.19.1+dfsg1-2.1+deb12u7), which carries these fixes for 2.3, and applied to 2.3.21.1. --- a/src/login-common/client-common-auth.c +++ b/src/login-common/client-common-auth.c @@ -3,6 +3,7 @@ #include "hostpid.h" #include "login-common.h" #include "array.h" +#include "base64.h" #include "iostream.h" #include "istream.h" #include "ostream.h" @@ -655,6 +656,14 @@ client_auth_handle_reply(struct client * void client_auth_respond(struct client *client, const char *response) { + /* Only accept base64 */ + for (size_t i = 0; response[i] != '\0'; i++) { + if (!base64_is_valid_char(response[i]) && response[i] != '=') { + client_auth_fail(client, "Invalid base64 in response"); + return; + } + } + client->auth_waiting = FALSE; client_set_auth_waiting(client); auth_client_request_continue(client->auth_request, response);