CVE-2004-2771: Input Validation

Published Nov 11, 2014
·
Updated

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

12 affected componentsFixes available
Oracle Linux=6
Oracle Linux=7
redhat Enterprise Linux=6.0
redhat Enterprise Linux=7.0
Bsd Mailx Project Bsd Mailx<=8.1.2
Heirloom mailx<=12.5
debian/bsd-mailx<8.1.2-0.20071201cvs-1
8.1.2-0.20071201cvs-1
debian/bsd-mailx<8.1.2-0.20071201cvs-1
8.1.2-0.20071201cvs-1
debian/bsd-mailx<8.1.2-0.20071201cvs-1
8.1.2-0.20071201cvs-1
debian/bsd-mailx
8.1.2-0.20071201cvs-1
debian/heirloom-mailx
12.4-2+deb6u112.5-2+deb7u112.5-3.1
debian/mailx
1:8.1.2-0.20040524cvs-2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/bsd-mailx to a version that resolves this vulnerability.

    Fixed in 8.1.2-0.20071201cvs-1
  2. Upgrade

    Upgrade debian/heirloom-mailx to a version that resolves this vulnerability.

    Fixed in 12.4-2+deb6u1Fixed in 12.5-2+deb7u1Fixed in 12.5-3.1
  3. Upgrade

    Upgrade debian/mailx to a version that resolves this vulnerability.

    Fixed in 1:8.1.2-0.20040524cvs-2

Event History

Nov 11, 2014
Data Sourced
via Red Hat·05:05 PM
DescriptionSeverityAffected Software
Dec 24, 2014
CVE Published
via MITRE·06:00 PM
Data Sourced
via MITRE·06:00 PM
Description
Data Sourced
06:59 PM
DescriptionWeaknessAffected Software
Data Sourced
via NVD·06:59 PM
DescriptionSeverityWeaknessAffected Software
Data Sourced
via OSV·06:59 PM
DescriptionAffected Software
CVE Published
via MITRE·11:00 PM
Feb 13, 2023
Data Sourced
01:15 AM
Severity

Parent advisories

This vulnerability appears in the following advisories.

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

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.

2

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.

3

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.

4

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.

5

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.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203