Dovecot SQL Authentication Bypass via Misconfigured Username Characters
A misconfiguration vulnerability in Dovecot (CVE-2026-24031) allows authentication bypass and user enumeration when the `auth_username_chars` setting is cleared, potentially leading to unauthorized access to mailboxes.
CVE search metadata
CVE search record: CVE-2026-24031. Severity: high. CVSS: 7.7. EPSS: 0.40%. KEV: no. Product: Dovecot (< 2.4.3), Dovecot (< 3.1.4). Brief: Dovecot SQL Authentication Bypass via Misconfigured Username Characters. Brief link: https://feed.craftedsignal.io/briefs/2026-03-dovecot-auth-bypass/
What's new
- 1. poc_available; added CVE-2026-24031 Oct 17, 00:45 via sploitus
CVE-2026-24031 describes an authentication bypass vulnerability affecting Dovecot, an open-source mail server. The vulnerability arises when the auth_username_chars setting, which defines the allowed characters in usernames, is cleared by an administrator. Disabling this setting allows for manipulation of SQL queries used for authentication, leading to potential bypass of authentication checks for any user and enabling user enumeration. The vulnerability was reported on March 27, 2026. There is no mention of publicly available exploits. The primary mitigation is to avoid clearing the auth_username_chars setting or to update to a patched version of Dovecot.
Attack Chain
- An attacker identifies a Dovecot server with SQL-based authentication.
- The attacker discovers that the
auth_username_charssetting is cleared. - The attacker crafts a malicious username containing SQL injection code.
- The attacker attempts to authenticate with the crafted username.
- Dovecot processes the username in an SQL query without proper sanitization due to the missing
auth_username_charsrestriction. - The malicious SQL code is executed, bypassing authentication checks.
- The attacker gains unauthorized access to a user's mailbox.
- The attacker may enumerate valid usernames by manipulating the SQL injection to extract user data.
Impact
Successful exploitation of CVE-2026-24031 allows attackers to bypass authentication and gain unauthorized access to user mailboxes on affected Dovecot servers. It also enables user enumeration, which can be used in subsequent attacks. The severity of the impact depends on the sensitivity of the information stored in the compromised mailboxes. A CVSS v3.1 score of 7.7 (HIGH) indicates a significant risk.
Recommendation
- Ensure the
auth_username_charssetting in Dovecot is not cleared to prevent SQL injection vulnerabilities as described in CVE-2026-24031. - Monitor Dovecot configuration files for changes to the
auth_username_charssetting using file integrity monitoring rules. - Deploy the Sigma rule provided below to detect attempts to authenticate with usernames containing potentially malicious characters based on the expected character set defined by
auth_username_chars. - Upgrade Dovecot to the latest patched version to address this vulnerability and other potential security issues.
Detection coverage 2
Detect Dovecot Authentication Attempt with Suspicious Characters
highDetects authentication attempts to Dovecot with usernames containing characters outside the standard alphanumeric range, potentially indicating SQL injection attempts if auth_username_chars is misconfigured.
Detect Dovecot Configuration File Modification for auth_username_chars
mediumDetects modification of Dovecot configuration files specifically targeting the auth_username_chars setting, which could indicate an attempt to introduce the vulnerability.
Detection queries are available on the platform. Get full rules →