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

Medium 6.1 Published Updated

Attackers can execute arbitrary commands via malicious whois responses in fail2ban's mail-whois action, requiring specific configuration.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2021-32749?

CVE-2021-32749 is a medium-severity command injection vulnerability in Fedoraproject Fedora, published on 16 Jul 2021. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

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.

Weakness: CWE-94, CWE-78

Which versions are affected by CVE-2021-32749?

It affects 2 products.

Linux distribution packages (6)
fail2ban SUSE:Package Hub 15 SP1All versions0.11.2-bp153.2.3.1
fail2ban SUSE:Package Hub 15 SP2All versions0.11.2-bp153.2.3.1
fail2ban SUSE:Package Hub 15 SP3All versions0.11.2-bp153.2.3.1
fail2ban openSUSE:Leap 15.2All versions0.11.2-bp153.2.3.1
fail2ban openSUSE:Leap 15.3All versions0.11.2-bp153.2.3.1
fail2ban openSUSE:TumbleweedAll versions0.11.2-3.1

Products include Fail2ban Fail2ban, Fedoraproject Fedora.

How do I fix CVE-2021-32749?

Upgrade to a fixed version.

Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.

Is CVE-2021-32749 being exploited?

There is no known exploitation of CVE-2021-32749 in the wild and no public exploit code.

All Fedoraproject Fedora vulnerabilities

Sources

Also known as ALPINE-CVE-2021-32749, DEBIAN-CVE-2021-32749, GHSA-m985-3f3v-cwmm, MGASA-2021-0464, UBUNTU-CVE-2021-32749, USN-5232-1 and 2 more.

Is CVE-2021-32749 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free