CVE-2021-32749
Possible RCE vulnerability in mailing action using mailutils (mail-whois)
fail2ban is a daemon to ban hosts that cause multiple authentication errors. In versions 0.9.7 and prior, 0.10.0 through 0.10.6, and 0.11.0 through 0.11.2, there is a vulnerability that leads to possible remote code execution in the mailing action mail-whois. Command mail from mailutils package used in mail actions like mail-whois can execute command if unescaped sequences (\n~) are available in "foreign" input (for instance in whois output). To exploit the vulnerability, an attacker would need to insert malicious characters into the response sent by the whois server, either via a MITM attack or by taking over a whois server. The issue is patched in versions 0.10.7 and 0.11.3. As a workaround, one may avoid the usage of action mail-whois or patch the vulnerability manually.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- High
- Privileges needed
- None
- User interaction
- Required
What an attacker can affect
- Confidentiality
- None
- Integrity
- High
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
6.1
Possible RCE vulnerability in mailing action using mailutils (mail-whois)
fail2ban is a daemon to ban hosts that cause multiple authentication errors. In versions 0.9.7 and prior, 0.10.0 through 0.10.6, and 0.11.0 through 0.11.2, there is a vulnerability that leads to possible remote code execution in the mailing action mail-whois. Command mail from mailutils package used in mail actions like mail-whois can execute command if unescaped sequences (\n~) are available in "foreign" input (for instance in whois output). To exploit the vulnerability, an attacker would need to insert malicious characters into the response sent by the whois server, either via a MITM attack or by taking over a whois server. The issue is patched in versions 0.10.7 and 0.11.3. As a workaround, one may avoid the usage of action mail-whois or patch the vulnerability manually.
- Record
CVE-2021-32749- CVSS 3.1
- 6.1 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:N/I:H/A:N - Weakness
- CWE-78
- Updated
- 2026-11-02
EUVDEUVD-2021-19521
6.1
fail2ban is a daemon to ban hosts that cause multiple authentication errors. In versions 0.9.7 and prior, 0.10.0 through 0.10.6, and 0.11.0 through 0.11.2, there is a vulnerability that leads to possible remote code execution in the mailing action mail-whois. Command mail from mailutils package used in mail actions like mail-whois can execute command if unescaped sequences (\n~) are available in "foreign" input (for instance in whois output). To exploit the vulnerability, an attacker would need to insert malicious characters into the response sent by the whois server, either via a MITM attack or by taking over a whois server. The issue is patched in versions 0.10.7 and 0.11.3. As a workaround, one may avoid the usage of action mail-whois or patch the vulnerability manually.
- Record
EUVD-2021-19521- CVSS 3.1
- 6.1 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:N/I:H/A:N - Updated
- 2026-11-03
NVD
6.1
fail2ban is a daemon to ban hosts that cause multiple authentication errors. In versions 0.9.7 and prior, 0.10.0 through 0.10.6, and 0.11.0 through 0.11.2, there is a vulnerability that leads to possible remote code execution in the mailing action mail-whois. Command mail from mailutils package used in mail actions like mail-whois can execute command if unescaped sequences (\n~) are available in "foreign" input (for instance in whois output). To exploit the vulnerability, an attacker would need to insert malicious characters into the response sent by the whois server, either via a MITM attack or by taking over a whois server. The issue is patched in versions 0.10.7 and 0.11.3. As a workaround, one may avoid the usage of action mail-whois or patch the vulnerability manually.
- Record
CVE-2021-32749- CVSS 3.1
- 6.1 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:N/I:H/A:N - CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H - CVSS 2.0
- 6.8 Medium
AV:N/AC:M/Au:N/C:P/I:P/A:P - Weakness
- CWE-78, CWE-94
- Updated
- 2026-11-02
OSVALPINE-CVE-2021-32749
8.1
fail2ban is a daemon to ban hosts that cause multiple authentication errors. In versions 0.9.7 and prior, 0.10.0 through 0.10.6, and 0.11.0 through 0.11.2, there is a vulnerability that leads to possible remote code execution in the mailing action mail-whois. Command mail from mailutils package used in mail actions like mail-whois can execute command if unescaped sequences (\n~) are available in "foreign" input (for instance in whois output). To exploit the vulnerability, an attacker would need to insert malicious characters into the response sent by the whois server, either via a MITM attack or by taking over a whois server. The issue is patched in versions 0.10.7 and 0.11.3. As a workaround, one may avoid the usage of action mail-whois or patch the vulnerability manually.
- Record
ALPINE-CVE-2021-32749- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSV
8.1
fail2ban is a daemon to ban hosts that cause multiple authentication errors. In versions 0.9.7 and prior, 0.10.0 through 0.10.6, and 0.11.0 through 0.11.2, there is a vulnerability that leads to possible remote code execution in the mailing action mail-whois. Command mail from mailutils package used in mail actions like mail-whois can execute command if unescaped sequences (\n~) are available in "foreign" input (for instance in whois output). To exploit the vulnerability, an attacker would need to insert malicious characters into the response sent by the whois server, either via a MITM attack or by taking over a whois server. The issue is patched in versions 0.10.7 and 0.11.3. As a workaround, one may avoid the usage of action mail-whois or patch the vulnerability manually.
- Record
CVE-2021-32749- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVDEBIAN-CVE-2021-32749
8.1
fail2ban is a daemon to ban hosts that cause multiple authentication errors. In versions 0.9.7 and prior, 0.10.0 through 0.10.6, and 0.11.0 through 0.11.2, there is a vulnerability that leads to possible remote code execution in the mailing action mail-whois. Command mail from mailutils package used in mail actions like mail-whois can execute command if unescaped sequences (\n~) are available in "foreign" input (for instance in whois output). To exploit the vulnerability, an attacker would need to insert malicious characters into the response sent by the whois server, either via a MITM attack or by taking over a whois server. The issue is patched in versions 0.10.7 and 0.11.3. As a workaround, one may avoid the usage of action mail-whois or patch the vulnerability manually.
- Record
DEBIAN-CVE-2021-32749- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
Show 5 moreShow less
OSVUBUNTU-CVE-2021-32749
6.1
fail2ban is a daemon to ban hosts that cause multiple authentication errors. In versions 0.9.7 and prior, 0.10.0 through 0.10.6, and 0.11.0 through 0.11.2, there is a vulnerability that leads to possible remote code execution in the mailing action mail-whois. Command mail from mailutils package used in mail actions like mail-whois can execute command if unescaped sequences (\n~) are available in "foreign" input (for instance in whois output). To exploit the vulnerability, an attacker would need to insert malicious characters into the response sent by the whois server, either via a MITM attack or by taking over a whois server. The issue is patched in versions 0.10.7 and 0.11.3. As a workaround, one may avoid the usage of action mail-whois or patch the vulnerability manually.
- Record
UBUNTU-CVE-2021-32749- CVSS 3.1
- 6.1 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:N/I:H/A:N - CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVMGASA-2021-0464 No score
Updated fail2ban packages fix security vulnerability
fail2ban is a daemon to ban hosts that cause multiple authentication errors.
In versions 0.9.7 and prior, 0.10.0 through 0.10.6, and 0.11.0 through
0.11.2, there is a vulnerability that leads to possible remote code
execution in the mailing action mail-whois. Command mail from mailutils
package used in mail actions like mail-whois can execute command if
unescaped sequences (\n~) are available in "foreign" input (for
instance in whois output). To exploit the vulnerability, an attacker would
need to insert malicious characters into the response sent by the whois
server, either via a MITM attack or by taking over a whois server.
(CVE-2021-32749)
- Record
MGASA-2021-0464- Updated
- 2026-11-02
OSVopenSUSE-SU-2021:1274-1 No score
Security update for fail2ban
This update for fail2ban fixes the following issues:
-
CVE-2021-32749: prevent a command injection via mail command (boo#1188610)
-
Integrate change to resolve boo#1146856 and boo#1180738
Update to 0.11.2
- increased stability, filter and action updates
New Features and Enhancements
- fail2ban-regex:
- speedup formatted output (bypass unneeded stats creation)
- extended with prefregex statistic
- more informative output for
datepattern(e. g. set from filter) - pattern : description
- parsing of action in jail-configs considers space between action-names as separator also
(previously only new-line was allowed), for example
action = a bwould specify 2 actionsaandb - new filter and jail for GitLab recognizing failed application logins (gh#fail2ban/fail2ban#2689)
- new filter and jail for Grafana recognizing failed application logins (gh#fail2ban/fail2ban#2855)
- new filter and jail for SoftEtherVPN recognizing failed application logins (gh#fail2ban/fail2ban#2723)
filter.d/guacamole.confextended withloggingparameter to follow webapp-logging if it's configured (gh#fail2ban/fail2ban#2631)filter.d/bitwarden.confenhanced to support syslog (gh#fail2ban/fail2ban#2778)- introduced new prefix
{UNB}fordatepatternto disable word boundaries in regex; - datetemplate: improved anchor detection for capturing groups
(^...); - datepattern: improved handling with wrong recognized timestamps (timezones, no datepattern, etc)
as well as some warnings signaling user about invalid pattern or zone (gh#fail2ban/fail2ban#2814):
- filter gets mode in-operation, which gets activated if filter starts processing of new messages;
in this mode a timestamp read from log-line that appeared recently (not an old line), deviating too much
from now (up too 24h), will be considered as now (assuming a timezone issue), so could avoid unexpected
bypass of failure (previously exceeding
findtime); - better interaction with non-matching optional datepattern or invalid timestamps;
- implements special datepattern
{NONE}- allow to find failures totally without date-time in log messages, whereas filter will use now as timestamp (gh#fail2ban/fail2ban#2802)
- filter gets mode in-operation, which gets activated if filter starts processing of new messages;
in this mode a timestamp read from log-line that appeared recently (not an old line), deviating too much
from now (up too 24h), will be considered as now (assuming a timezone issue), so could avoid unexpected
bypass of failure (previously exceeding
- performance optimization of
datepattern(better search algorithm in datedetector, especially for single template); - fail2ban-client: extended to unban IP range(s) by subnet (CIDR/mask) or hostname (DNS), gh#fail2ban/fail2ban#2791;
- extended capturing of alternate tags in filter, allowing combine of multiple groups to single tuple token with new tag
prefix
<F-TUPLE_, that would combine value of<F-V>with all value of<F-TUPLE_V?_n?>tags (gh#fail2ban/fail2ban#2755)
- Fixes
- [stability] prevent race condition - no ban if filter (backend) is continuously busy if too many messages will be found in log, e. g. initial scan of large log-file or journal (gh#fail2ban/fail2ban#2660)
- pyinotify-backend sporadically avoided initial scanning of log-file by start
- python 3.9 compatibility (and Travis CI support)
- restoring a large number (500+ depending on files ulimit) of current bans when using PyPy fixed
- manual ban is written to database, so can be restored by restart (gh#fail2ban/fail2ban#2647)
jail.conf: don't specifyactiondirectly in jails (useaction_orbanactioninstead)- no mails-action added per default anymore (e. g. to allow that
action = %(action_mw)sshould be specified per jail or in default section in jail.local), closes gh#fail2ban/fail2ban#2357 - ensure we've unique action name per jail (also if parameter
actnameis not set but name deviates from standard name, gh#fail2ban/fail2ban#2686) - don't use
%(banaction)sinterpolation because it can be complex value (containing[...]and/or quotes), so would bother the action interpolation - fixed type conversion in config readers (take place after all interpolations get ready), that allows to specify typed parameters variable (as…
- Record
openSUSE-SU-2021:1274-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2024:10749-1 No score
fail2ban-0.11.2-3.1 on GA media
These are all security issues fixed in the fail2ban-0.11.2-3.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2024:10749-1- Updated
- 2026-11-02
OSVUSN-5232-1 No score
fail2ban vulnerability
Jakub Żoczek discovered that certain Fail2ban actions handled whois responses in an insecure way. If Fail2ban was configured to use certain mail actions like 'mail-whois' on a target system, a remote attacker who was able to control whois responses to this target system could possibly execute arbitrary code.
- Record
USN-5232-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
fail2banAlpine:v3.15 |
0.10.0 up to 0.11.2-r1 | 0.11.2-r1 |
fail2banAlpine:v3.16 |
0.10.0 up to 0.11.2-r2 | 0.11.2-r2 |
fail2banAlpine:v3.17 |
0.10.0 up to 0.11.2-r2 | 0.11.2-r2 |
fail2banAlpine:v3.18 |
0.10.0 up to 0.11.2-r2 | 0.11.2-r2 |
fail2banAlpine:v3.19 |
0.10.0 up to 0.11.2-r2 | 0.11.2-r2 |
fail2banAlpine:v3.20 |
0.10.0 up to 0.11.2-r2 | 0.11.2-r2 |
fail2banAlpine:v3.21 |
0.10.0 up to 0.11.2-r2 | 0.11.2-r2 |
fail2banAlpine:v3.22 |
0.10.0 up to 0.11.2-r2 | 0.11.2-r2 |
fail2banAlpine:v3.23 |
0.10.0 up to 0.11.2-r2 | 0.11.2-r2 |
fail2banAlpine:v3.24 |
0.10.0 up to 0.11.2-r2 | 0.11.2-r2 |
Show 14 moreShow less
| Package | Affected | Fixed |
|---|---|---|
fail2banDebian:12 |
before 0.11.2-2 | 0.11.2-2 |
fail2banDebian:13 |
before 0.11.2-2 | 0.11.2-2 |
fail2banDebian:14 |
before 0.11.2-2 | 0.11.2-2 |
fail2banMageia:8 |
before 0.11.2-1.1.mga8 | 0.11.2-1.1.mga8 |
fail2banUbuntu:Pro:14.04:LTS |
before 0.8.11-1ubuntu0.1~esm1, plus listed versions 0.8.10-30.8.11~pre1+git29-gccd2657-10.8.11-1 |
0.8.11-1ubuntu0.1~esm1 |
fail2banUbuntu:Pro:16.04:LTS |
before 0.9.3-1ubuntu0.1~esm1, plus listed versions 0.9.3-1 |
0.9.3-1ubuntu0.1~esm1 |
fail2banUbuntu:Pro:18.04:LTS |
before 0.10.2-2ubuntu0.1~esm1, plus listed versions 0.9.7-20.10.2-10.10.2-2 |
0.10.2-2ubuntu0.1~esm1 |
fail2banUbuntu:Pro:20.04:LTS |
before 0.11.1-1ubuntu0.1~esm1, plus listed versions 0.10.2-2.10.11.1-1 |
0.11.1-1ubuntu0.1~esm1 |
fail2banSUSE:Package Hub 15 SP1 |
before 0.11.2-bp153.2.3.1 | 0.11.2-bp153.2.3.1 |
fail2banSUSE:Package Hub 15 SP2 |
before 0.11.2-bp153.2.3.1 | 0.11.2-bp153.2.3.1 |
fail2banSUSE:Package Hub 15 SP3 |
before 0.11.2-bp153.2.3.1 | 0.11.2-bp153.2.3.1 |
fail2banopenSUSE:Leap 15.2 |
before 0.11.2-bp153.2.3.1 | 0.11.2-bp153.2.3.1 |
fail2banopenSUSE:Leap 15.3 |
before 0.11.2-bp153.2.3.1 | 0.11.2-bp153.2.3.1 |
fail2banopenSUSE:Tumbleweed |
before 0.11.2-3.1 | 0.11.2-3.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| aliases | EUVD | |
| first indexed | CVE List, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2021-32749 is a medium vulnerability (CVSS 6.1) in Fail2ban, published July 16, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 3.43%, the 88th percentile. Fixed in fail2ban 0.11.2-r1.
References
github.com/fail2ban/fail2ban/security/advisories/GHSA-m985-3f3v-cwmm
github.com/fail2ban/fail2ban/commit/2ed414ed09b3bb4c478abc9366a1ff22024a33c9
github.com/fail2ban/fail2ban/commit/410a6ce5c80dd981c22752da034f2529b5eee844
lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/5WHJK2X2MR2WDYZMCW7COZXJDUSDYMY6
lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ZRYQ77MTX5WSV33VCJLK4KBKR55QZ7ZA
security.gentoo.org/glsa/202310-13
Show 14 moreShow less
security.alpinelinux.org/vuln/CVE-2021-32749
security-tracker.debian.org/tracker/CVE-2021-32749
advisories.mageia.org/MGASA-2021-0464.html
bugs.mageia.org/show_bug.cgi?id=29469
lists.opensuse.org/archives/list/[email protected]/thread/RYBYCPVAMLJBPZO42ZMSVOQTCNN3YNQS
bugzilla.suse.com/show_bug.cgi?id=1188610
ubuntu.com/security/CVE-2021-32749
ubuntu.com/security/notices/USN-5232-1
cve.org/CVERecord?id=CVE-2021-32749
bugzilla.suse.com/1145181
bugzilla.suse.com/1146856
bugzilla.suse.com/1180738
bugzilla.suse.com/1188610
suse.com/security/cve/CVE-2021-32749
Left out here: the rest of 1 source description. The JSON record has them.