Every CVE Search/ Get API key

CVE-2021-32749

Possible RCE vulnerability in mailing action using mailutils (mail-whois)

6.1 MediumFix available

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

3.43%Up 1.6 points since Jul 17, 2021
90%50%10%1%

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 MediumCVSS: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 MediumCVSS: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 MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:N/I:H/A:N
CVSS 3.1
8.1 HighCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS 2.0
6.8 MediumAV: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 HighCVSS: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 HighCVSS: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 HighCVSS: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 MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:N/I:H/A:N
CVSS 3.1
8.1 HighCVSS: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 b would specify 2 actions a and b
  • 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.conf extended with logging parameter to follow webapp-logging if it's configured (gh#fail2ban/fail2ban#2631)
  • filter.d/bitwarden.conf enhanced to support syslog (gh#fail2ban/fail2ban#2778)
  • introduced new prefix {UNB} for datepattern to 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)
  • 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 specify action directly in jails (use action_ or banaction instead)
  • no mails-action added per default anymore (e. g. to allow that action = %(action_mw)s should 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 actname is not set but name deviates from standard name, gh#fail2ban/fail2ban#2686)
  • don't use %(banaction)s interpolation 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

Affected packages
PackageAffectedFixed
fail2ban
Alpine:v3.15
0.10.0 up to 0.11.2-r1
0.11.2-r1
fail2ban
Alpine:v3.16
0.10.0 up to 0.11.2-r2
0.11.2-r2
fail2ban
Alpine:v3.17
0.10.0 up to 0.11.2-r2
0.11.2-r2
fail2ban
Alpine:v3.18
0.10.0 up to 0.11.2-r2
0.11.2-r2
fail2ban
Alpine:v3.19
0.10.0 up to 0.11.2-r2
0.11.2-r2
fail2ban
Alpine:v3.20
0.10.0 up to 0.11.2-r2
0.11.2-r2
fail2ban
Alpine:v3.21
0.10.0 up to 0.11.2-r2
0.11.2-r2
fail2ban
Alpine:v3.22
0.10.0 up to 0.11.2-r2
0.11.2-r2
fail2ban
Alpine:v3.23
0.10.0 up to 0.11.2-r2
0.11.2-r2
fail2ban
Alpine:v3.24
0.10.0 up to 0.11.2-r2
0.11.2-r2
Show 14 moreShow less
Affected packages
PackageAffectedFixed
fail2ban
Debian:12
before 0.11.2-2
0.11.2-2
fail2ban
Debian:13
before 0.11.2-2
0.11.2-2
fail2ban
Debian:14
before 0.11.2-2
0.11.2-2
fail2ban
Mageia:8
before 0.11.2-1.1.mga8
0.11.2-1.1.mga8
fail2ban
Ubuntu: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
fail2ban
Ubuntu:Pro:16.04:LTS
before 0.9.3-1ubuntu0.1~esm1, plus listed versions
0.9.3-1
0.9.3-1ubuntu0.1~esm1
fail2ban
Ubuntu: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
fail2ban
Ubuntu: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
fail2ban
SUSE:Package Hub 15 SP1
before 0.11.2-bp153.2.3.1
0.11.2-bp153.2.3.1
fail2ban
SUSE:Package Hub 15 SP2
before 0.11.2-bp153.2.3.1
0.11.2-bp153.2.3.1
fail2ban
SUSE:Package Hub 15 SP3
before 0.11.2-bp153.2.3.1
0.11.2-bp153.2.3.1
fail2ban
openSUSE:Leap 15.2
before 0.11.2-bp153.2.3.1
0.11.2-bp153.2.3.1
fail2ban
openSUSE:Leap 15.3
before 0.11.2-bp153.2.3.1
0.11.2-bp153.2.3.1
fail2ban
openSUSE:Tumbleweed
before 0.11.2-3.1
0.11.2-3.1

History

History
RecordedChangedSources
aliasesEUVD
first indexedCVE 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

Show 14 moreShow less
This page doesn't list everything

Left out here: the rest of 1 source description. The JSON record has them.

MoveEnter Open