← Vulnerability feed

Vulnerability record · CVE-2020-7247 · published 29 January 2020

CVE-2020-7247: OpenSMTPD MAIL FROM command injection allows remote root code execution

Openbsd · Opensmtpd

OpenSMTPD 6.6, as shipped in OpenBSD 6.6 and other products, mishandles input validation in smtp_mailaddr in smtp_session.c, returning an incorrect value on validation failure. A remote attacker can inject shell metacharacters through the MAIL FROM field of an SMTP session and execute arbitrary commands as root. The flaw affects the default uncommented configuration, so exposed mail servers need no special setup to be at risk.

9.8 CVSS 3.1 Critical CISA KEV since 25 Mar 2022 EPSS 99% · top 0.1% CWE-78 · OS command injectionCWE-755 · CWE-755
9.8CVSS 3.1 base score, v2 10.0
99%EPSS exploitation probability, 30 days
YesIn CISA KEV, fix deadline passed
4Affected product versions listed by NVD
29References, 12 tagged exploit
17 Jun 2026Last modified by NVD

Description

smtp_mailaddr in smtp_session.c in OpenSMTPD 6.6, as used in OpenBSD 6.6 and other products, allows remote attackers to execute arbitrary commands as root via a crafted SMTP session, as demonstrated by shell metacharacters in a MAIL FROM field. This affects the "uncommented" default configuration. The issue exists because of an incorrect return value upon failure of input validation.

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Automated analysis

Generated by VULONE's analysis model from the NVD record, CISA KEV and EPSS data on 16 September 2026. Confidence: high.

critical priorityUnauthenticated remote code execution as root in a default configuration, with public exploits, KEV listing and near-maximum EPSS probability.

What it is

OpenSMTPD 6.6, as shipped in OpenBSD 6.6 and other products, mishandles input validation in smtp_mailaddr in smtp_session.c, returning an incorrect value on validation failure. A remote attacker can inject shell metacharacters through the MAIL FROM field of an SMTP session and execute arbitrary commands as root. The flaw affects the default uncommented configuration, so exposed mail servers need no special setup to be at risk.

Impact

An unauthenticated remote attacker gains arbitrary command execution with root privileges on the mail server. That yields full control of the host, including mail data, credentials and any services reachable from it.

Attack surface

Reachable over the network through the SMTP service on port 25 by sending a crafted MAIL FROM value; no authentication or user interaction is required per the CVSS vector AV:N/AC:L/PR:N/UI:N. Only systems running the affected OpenSMTPD 6.6 default configuration are exposed.

Exploitation

CISA added this to the Known Exploited Vulnerabilities catalog on 2022-03-25, and EPSS shows a 30-day probability of 0.98972 (99.9th percentile). Multiple public references are tagged Exploit, so working exploit code is publicly available.

What to do

  • Patch OpenSMTPD to a fixed release immediately; apply the OpenBSD source commit 9dcfda045474d8903224d175907bfc29761dcb45 or the vendor update for your distribution (Debian DSA-4611, Ubuntu USN-4268-1, Fedora advisory).
  • If patching cannot be done at once, restrict SMTP access to trusted networks and hosts with firewall rules rather than leaving port 25 open to the internet.
  • Verify the running smtpd version and confirm the default uncommented configuration is not in use on internet-facing hosts.
  • Monitor vendor and CISA KEV guidance for the required remediation deadline and confirm completion before 2022-04-15-style due dates for any remaining instances.

Detection

  • Inspect SMTP logs for MAIL FROM values containing shell metacharacters such as backticks, semicolons, pipes or command substitution syntax.
  • Alert on unexpected child processes spawned by the smtpd process, especially shells or commands not normally invoked by the mail daemon.
  • Hunt for outbound connections or file writes originating from the mail server host that do not match normal mail relay behavior.
  • Check host and package inventories for OpenSMTPD 6.6 and confirm the patched version is installed.

This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.

Exploitation in the wild

CISA added CVE-2020-7247 to the Known Exploited Vulnerabilities catalog on 25 March 2022 as "OpenSMTPD Remote Code Execution Vulnerability". Required action: Apply updates per vendor instructions. Federal deadline 15 April 2022.

Affected products

4 vulnerable configurations from NVD's CPE data, grouped by vendor and product.

References

LinkTags
http://packetstormsecurity.com/files/156137/OpenBSD-OpenSMTPD-Privilege-Escalation-Code-Execution.html ExploitThird Party AdvisoryVDB Entry
http://packetstormsecurity.com/files/156145/OpenSMTPD-6.6.2-Remote-Code-Execution.html ExploitThird Party AdvisoryVDB Entry
http://packetstormsecurity.com/files/156249/OpenSMTPD-MAIL-FROM-Remote-Code-Execution.html ExploitThird Party AdvisoryVDB Entry
http://packetstormsecurity.com/files/156295/OpenSMTPD-6.6.1-Local-Privilege-Escalation.html ExploitThird Party AdvisoryVDB Entry
http://packetstormsecurity.com/files/162093/OpenBSD-OpenSMTPD-6.6-Remote-Code-Execution.html Broken LinkThird Party AdvisoryVDB Entry
http://seclists.org/fulldisclosure/2020/Jan/49 ExploitMailing ListThird Party Advisory
http://www.openwall.com/lists/oss-security/2020/01/28/3 ExploitMailing ListThird Party Advisory
https://github.com/openbsd/src/commit/9dcfda045474d8903224d175907bfc29761dcb45 Patch
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/OPH4QU4DNVHA7ACFXMYFCEP Mailing ListThird Party Advisory
https://seclists.org/bugtraq/2020/Jan/51 Mailing ListThird Party Advisory
https://usn.ubuntu.com/4268-1/ Third Party Advisory
https://www.debian.org/security/2020/dsa-4611 Mailing ListThird Party Advisory
https://www.kb.cert.org/vuls/id/390745 Third Party AdvisoryUS Government Resource
https://www.openbsd.org/security.html PatchVendor Advisory
http://packetstormsecurity.com/files/156137/OpenBSD-OpenSMTPD-Privilege-Escalation-Code-Execution.html ExploitThird Party AdvisoryVDB Entry
http://packetstormsecurity.com/files/156145/OpenSMTPD-6.6.2-Remote-Code-Execution.html ExploitThird Party AdvisoryVDB Entry
http://packetstormsecurity.com/files/156249/OpenSMTPD-MAIL-FROM-Remote-Code-Execution.html ExploitThird Party AdvisoryVDB Entry
http://packetstormsecurity.com/files/156295/OpenSMTPD-6.6.1-Local-Privilege-Escalation.html ExploitThird Party AdvisoryVDB Entry
http://packetstormsecurity.com/files/162093/OpenBSD-OpenSMTPD-6.6-Remote-Code-Execution.html Broken LinkThird Party AdvisoryVDB Entry
http://seclists.org/fulldisclosure/2020/Jan/49 ExploitMailing ListThird Party Advisory
http://www.openwall.com/lists/oss-security/2020/01/28/3 ExploitMailing ListThird Party Advisory
https://github.com/openbsd/src/commit/9dcfda045474d8903224d175907bfc29761dcb45 Patch
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/OPH4QU4DNVHA7ACFXMYFCEP Mailing ListThird Party Advisory
https://seclists.org/bugtraq/2020/Jan/51 Mailing ListThird Party Advisory
https://usn.ubuntu.com/4268-1/ Third Party Advisory
https://www.debian.org/security/2020/dsa-4611 Mailing ListThird Party Advisory
https://www.kb.cert.org/vuls/id/390745 Third Party AdvisoryUS Government Resource
https://www.openbsd.org/security.html PatchVendor Advisory
https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2020-7247 US Government Resource

Track CVE-2020-7247 inside VULONE

Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.

Start free Open in platform

Related vulnerabilities

Same products first, then exploited flaws of the same weakness class.

10.0CVE-2025-32433Erlang/OTP SSH server missing authentication allows remote code executionErlang/OTP SSH servers before OTP-27.3.3, OTP-26.2.5.11 and OTP-25.3.2.20 mishandle SSH protocol messages, letting an unauthenticated attacker execut…KEVEPSS 99%analysed10.0CVE-2025-24201Apple WebKit out-of-bounds write allows sandbox escapeCVE-2025-24201 is an out-of-bounds write in Apple's WebKit that was addressed with improved checks. Maliciously crafted web content may break out of …KEVEPSS 3.8%analysed10.0CVE-2021-44228Apache Log4j2 JNDI lookup remote code executionApache Log4j2 versions 2.0-beta9 through 2.15.0 (excluding 2.12.2, 2.12.3, and 2.3.1) do not protect against attacker-controlled LDAP and other JNDI …KEVEPSS 100%analysed9.8CVE-2026-24061GNU Inetutils telnetd argument injection allows remote auth bypasstelnetd in GNU Inetutils through 2.7 fails to sanitize the USER environment variable, so a value such as "-f root" is passed as an argument to login …KEVEPSS 99%analysed9.8CVE-2025-39682Linux kernel TLS zero-length record handling flaw on rx_listThe Linux kernel TLS receive path mishandles zero-length records that arrive from the rx_list, breaking the assumption that a record type change cann…KEVEPSS 2.9%analysed9.8CVE-2025-24813Apache Tomcat Default Servlet path equivalence enables RCE and file disclosureApache Tomcat mishandles path equivalence for names containing an internal dot, letting a remote unauthenticated attacker write files through the Def…KEVEPSS 100%analysed9.8CVE-2024-9680Mozilla Firefox and Thunderbird use-after-free in Animation timelinesA use-after-free flaw in Animation timelines allows an attacker to execute code in the content process of Firefox and Thunderbird. Mozilla reports ex…KEVEPSS 23%analysed9.8CVE-2024-4577PHP-CGI on Windows argument injection leads to remote code executionPHP-CGI on Windows can misinterpret characters in the command line passed to Win32 API functions when certain code pages are configured, due to Windo…KEVEPSS 100%analysed

Source: NIST National Vulnerability Database (record CVE-2020-7247), CISA KEV, FIRST EPSS (scores of 2026-09-22). This page is refreshed as NVD updates the record.