Every CVE Search/ Get API key

CVE-2020-7247

smtp_mailaddr in smtp_session.c in OpenSMTPD 6.6, as used in OpenBSD 6.6 and other products,...

9.8 CriticalIn KEVPublic exploitFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
High
Integrity
High
Availability
High

Exploit likelihood

99.0%Up 28.9 points since Apr 14, 2021
90%50%10%1%

What each source reports

NVD Score used 9.8

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.

Record
CVE-2020-7247
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS 2.0
10.0 HighAV:N/AC:L/Au:N/C:C/I:C/A:C
Weakness
CWE-78, CWE-755
Updated
2026-11-02
CVE List 9.8

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.

Record
CVE-2020-7247
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-755
Updated
2026-11-02
EUVDEUVD-2020-28374 9.8

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.

Record
EUVD-2020-28374
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
GitHub AdvisoriesGHSA-rcw6-69h3-89fh 9.8

smtp_mailaddr in smtp_session.c in OpenSMTPD 6.6, as used in OpenBSD 6.6 and other products,...

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.

Record
GHSA-rcw6-69h3-89fh
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-78, CWE-252, CWE-755
Updated
2026-11-02
CISA KEV No score

OpenSMTPD Remote Code Execution Vulnerability

smtp_mailaddr in smtp_session.c in OpenSMTPD, as used in OpenBSD and other products, allows remote attackers to execute arbitrary commands as root via a crafted SMTP session.

Record
CVE-2020-7247
Weakness
CWE-755, CWE-78
Updated
2026-11-02
OSVALPINE-CVE-2020-7247 9.8

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.

Record
ALPINE-CVE-2020-7247
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-03
Show 5 moreShow less
OSV 9.8

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.

Record
CVE-2020-7247
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVDEBIAN-CVE-2020-7247 9.8

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.

Record
DEBIAN-CVE-2020-7247
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVUBUNTU-CVE-2020-7247 9.8

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.

Record
UBUNTU-CVE-2020-7247
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVUSN-4268-1 No score

OpenSMTPD vulnerability

It was discovered that OpenSMTPD incorrectly verified the sender's or receiver's e-mail addresses under certain conditions. An attacker could use this vulnerability to execute arbitrary commands as root.

Record
USN-4268-1
Updated
2026-11-02
OSVUSN-4875-1 No score

opensmtpd vulnerabilities

It was discovered that OpenSMTPD incorrectly verified the sender's or receiver's e-mail addresses under certain conditions. An attacker could possibly use this vulnerability to execute arbitrary commands as root. (CVE-2020-7247)

It was discovered that OpenSMTPD did not properly handle hardlinks under certain conditions. An unprivileged local attacker could possibly use this issue to obtain sensitive information. This issue only affected Ubuntu 16.04 ESM. (CVE-2020-8793)

It was discovered that OpenSMTPD mishandled certain input. A remote, unauthenticated attacker could possibly use this vulnerability to execute arbitrary shell commands as any non-root user. This issue only affected Ubuntu 16.04 ESM. (CVE-2020-8794)

Record
USN-4875-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
opensmtpd
Alpine:v3.11
before 6.6.2p1-r0
6.6.2p1-r0
opensmtpd
Alpine:v3.12
before 6.6.2p1-r0
6.6.2p1-r0
opensmtpd
Alpine:v3.13
before 6.6.2p1-r0
6.6.2p1-r0
opensmtpd
Alpine:v3.14
before 6.6.2p1-r0
6.6.2p1-r0
opensmtpd
Alpine:v3.15
before 6.6.2p1-r0
6.6.2p1-r0
opensmtpd
Alpine:v3.16
before 6.6.2p1-r0
6.6.2p1-r0
opensmtpd
Alpine:v3.17
before 6.6.2p1-r0
6.6.2p1-r0
opensmtpd
Alpine:v3.18
before 6.6.2p1-r0
6.6.2p1-r0
opensmtpd
Alpine:v3.19
before 6.6.2p1-r0
6.6.2p1-r0
opensmtpd
Alpine:v3.20
before 6.6.2p1-r0
6.6.2p1-r0
Show 13 moreShow less
Affected packages
PackageAffectedFixed
opensmtpd
Alpine:v3.21
before 6.6.2p1-r0
6.6.2p1-r0
opensmtpd
Alpine:v3.22
before 6.6.2p1-r0
6.6.2p1-r0
opensmtpd
Alpine:v3.23
before 6.6.2p1-r0
6.6.2p1-r0
opensmtpd
Alpine:v3.24
before 6.6.2p1-r0
6.6.2p1-r0
opensmtpd
Debian:12
before 6.6.2p1-1
6.6.2p1-1
opensmtpd
Debian:13
before 6.6.2p1-1
6.6.2p1-1
opensmtpd
Debian:14
before 6.6.2p1-1
6.6.2p1-1
opensmtpd
Debian:9
before 6.0.2p1-2+deb9u2, plus listed versions
6.0.2p1-26.0.2p1-2+deb9u1
6.0.2p1-2+deb9u2
opensmtpd
Debian:10
before 6.0.3p1-5+deb10u3, plus listed versions
6.0.3p1-56.0.3p1-5+deb10u16.0.3p1-5+deb10u2
6.0.3p1-5+deb10u3
opensmtpd
Ubuntu:Pro:14.04:LTS
before 5.4.1p1-1ubuntu0.1~esm1, plus listed versions
5.3.3p1-45.4.1p1-1
5.4.1p1-1ubuntu0.1~esm1
opensmtpd
Ubuntu:Pro:16.04:LTS
before 5.7.3p2-1ubuntu0.1~esm1, plus listed versions
5.4.2p1-45.7.3p1-15.7.3p2-1
5.7.3p2-1ubuntu0.1~esm1
opensmtpd
Ubuntu:18.04:LTS
before 6.0.3p1-1ubuntu0.1, plus listed versions
6.0.2p1-2build16.0.3p1-16.0.3p1-1build1
6.0.3p1-1ubuntu0.1
opensmtpd
Ubuntu:Pro:16.04:LTS
before 5.7.3p2-1ubuntu0.1~esm2, plus listed versions
5.4.2p1-45.7.3p1-15.7.3p2-15.7.3p2-1ubuntu0.1~esm1
5.7.3p2-1ubuntu0.1~esm2

Public exploits

Links only. Every CVE stores no exploit code.

Public exploits
SourceLinkDate
MetasploitOpenSMTPD MAIL FROM Remote Code Execution2020-01-28
Exploit-DBOpenSMTPD 6.6.1 - Remote Code Execution2020-01-30
PoC in GitHubFiroSolutions/cve-2020-7247-exploit2020-01-30
Exploit-DBOpenSMTPD - MAIL FROM Remote Code Execution (Metasploit)2020-02-10
Exploit-DBOpenSMTPD 6.4.0 < 6.6.1 - Local Privilege Escalation + Remote Code Execution2020-02-11
PoC in GitHubsuperzerosec/cve-2020-72472020-02-17
PoC in GitHubr0lh/CVE-2020-72472020-02-18
PoC in GitHubQTranspose/CVE-2020-7247-exploit2021-02-13
PoC in GitHubbytescrappers/CVE-2020-72472021-06-02
PoC in GitHubf4T1H21/CVE-2020-72472021-06-19
Show 6 moreShow less
Public exploits
SourceLinkDate
PoC in GitHubSimonSchoeni/CVE-2020-7247-POC2021-11-26
PoC in GitHubpresentdaypresenttime/shai_hulud2022-02-07
PoC in GitHubminhluannguyen/CVE-2020-7247-reproducer2025-03-20
PoC in GitHubsolmin111/OpenSMTPD-CVE-2020-7247-2026-06-28
PoC in GitHubCyberCTF/vulhub-opensmtpd-cve-2020-72472026-10-08
NucleiOpenSMTPD 6.4.0-6.6.1 - Remote Code Execution

History

History
RecordedChangedSources
exploitation
affected, exploitsOSV
first indexedCVE List, EUVD, Exploit-DB, GitHub Advisories, CISA KEV, Metasploit, Nuclei, NVD, OSV, PoC in GitHub

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2020-7247 is a critical vulnerability (CVSS 9.8) in Openbsd Opensmtpd, published January 29, 2020. CISA lists it as known to be exploited, since March 25, 2022. EUVD reports exploitation since March 25, 2022. Public exploit code exists. EPSS puts the chance of exploitation in the next 30 days at 99.0%, the 99th percentile. Fixed in opensmtpd 6.6.2p1-r0.

References

Show 23 moreShow less
MoveEnter Open