CVE-2004-2771: Input Validation
Florian Weimer from Red Hat has reported the below issue:
mailx executes shell commands embedded in syntactically valid mail addresses due a not quoted command to prevent word expansion.
fio.c 542 } 543 snprintf(cmdbuf, sizeof cmdbuf, "echo %s", name); 544 if ((shell = value("SHELL")) == NULL) 545 shell = SHELL;
The original report in Debian bugtracker: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=278748
Other sources
The expand function in fio.c in Heirloom mailx 12.5 and earlier and BSD mailx 8.1.2 and earlier allows remote attackers to execute arbitrary commands via shell metacharacters in an email address.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/bsd-mailxto a version that resolves this vulnerability.Fixed in 8.1.2-0.20071201cvs-1 - Upgrade
Upgrade
debian/heirloom-mailxto a version that resolves this vulnerability.Fixed in 12.4-2+deb6u1Fixed in 12.5-2+deb7u1Fixed in 12.5-3.1 - Upgrade
Upgrade
debian/mailxto a version that resolves this vulnerability.Fixed in 1:8.1.2-0.20040524cvs-2
Event History
Frequently Asked Questions
What is the severity of CVE-2004-2771?
CVE-2004-2771 is considered a high severity vulnerability due to its potential for remote code execution.
How do I fix CVE-2004-2771?
To fix CVE-2004-2771, upgrade Heirloom mailx to version 12.5.1 or later, or update BSD mailx to version 8.1.3 or later.
What types of systems are affected by CVE-2004-2771?
CVE-2004-2771 affects Heirloom mailx versions 12.5 and earlier, and BSD mailx versions 8.1.2 and earlier, along with specific versions of Oracle and Red Hat Linux.
What is the exploit method for CVE-2004-2771?
CVE-2004-2771 can be exploited by injecting shell metacharacters into an email address, allowing remote attackers to execute arbitrary commands.
Is CVE-2004-2771 still a relevant vulnerability today?
While CVE-2004-2771 is an older vulnerability, it remains relevant for systems still running affected versions of mailx software.