CVE-2020-7247

CRITICAL KEV NUCLEI

OpenSMTPD 6.6 - Remote Code Execution via MAIL FROM Field

Title source: llm
STIX 2.1

Exploitation Summary

CVE-2020-7247 is actively exploited and listed in the CISA Known Exploited Vulnerabilities (KEV) catalog, added March 25, 2022. EIP tracks 15 public exploits from researchers including Marco Ivaldi, Metasploit, 1F98D, including a Metasploit module exploits/unix/smtp/opensmtpd_mail_from_rce. A Nuclei detection template is also available.

AI-analyzed exploit summary This exploit leverages CVE-2020-7247 in OpenSMTPD 6.4.0-6.6.1, where incorrect input validation in the `smtp_mailaddr` function allows command injection via shell metacharacters in the MAIL FROM field. It supports both local privilege escalation (LPE) and remote code execution (RCE) by sending a crafted SMTP session to execute arbitrary commands as root.

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.

Exploits (15)

exploitdb WORKING POC VERIFIED
by Marco Ivaldi · perlremoteopenbsd
https://www.exploit-db.com/exploits/48051

This exploit leverages CVE-2020-7247 in OpenSMTPD 6.4.0-6.6.1, where incorrect input validation in the `smtp_mailaddr` function allows command injection via shell metacharacters in the MAIL FROM field. It supports both local privilege escalation (LPE) and remote code execution (RCE) by sending a crafted SMTP session to execute arbitrary commands as root.

Classification
Working Poc 100%
Attack Type
Rce | Lpe
Complexity
Moderate
Reliability
Reliable
Target: OpenSMTPD 6.4.0 - 6.6.1
No auth needed
Prerequisites: OpenSMTPD running with default or uncommented configuration · Network access to SMTP port (25) for RCE · Local access for LPE
devstral-2 · analyzed Feb 16, 2026 Full analysis →
exploitdb WORKING POC VERIFIED
by Metasploit · rubyremotelinux
https://www.exploit-db.com/exploits/48038

This Metasploit module exploits a command injection vulnerability in OpenSMTPD's MAIL FROM field to achieve remote code execution as root. It uses a comment slide technique to bypass input restrictions and deliver a payload.

Classification
Working Poc 100%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: OpenSMTPD (versions with commit a8e222352f or later)
No auth needed
Prerequisites: Network access to the SMTP port (default 25) · Valid recipient email address
devstral-2 · analyzed Feb 16, 2026 Full analysis →
exploitdb WORKING POC VERIFIED
by 1F98D · pythonremotelinux
https://www.exploit-db.com/exploits/47984

This exploit leverages a command injection vulnerability in OpenSMTPD by sending a maliciously crafted MAIL FROM command to execute arbitrary shell commands. The vulnerability arises from inadequate escaping of user-controlled input.

Classification
Working Poc 100%
Attack Type
Rce
Complexity
Trivial
Reliability
Reliable
Target: OpenSMTPD < 6.6.2
No auth needed
Prerequisites: Network access to the SMTP port (typically 25) · OpenSMTPD version < 6.6.2
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec WORKING POC 25 stars
by FiroSolutions · poc
https://github.com/FiroSolutions/cve-2020-7247-exploit

This repository contains a functional Python exploit for CVE-2020-7247, a remote command execution vulnerability in OpenSMTPD. The exploit leverages a flaw in the mail address parser to inject shell commands, allowing arbitrary file writes and command execution.

Classification
Working Poc 95%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: OpenSMTPD (versions prior to 6.6.4p1)
No auth needed
Prerequisites: Network access to the OpenSMTPD service (port 25)
devstral-2 · analyzed Feb 18, 2026 Full analysis →
nomisec WORKING POC 11 stars
by QTranspose · remote
https://github.com/QTranspose/CVE-2020-7247-exploit

This repository contains a functional exploit for CVE-2020-7247, targeting OpenSMTPD versions 6.4.0 to 6.6.1. The exploit leverages a command injection vulnerability in the SMTP server to achieve remote code execution via a crafted MAIL FROM command.

Classification
Working Poc 100%
Attack Type
Rce
Complexity
Trivial
Reliability
Reliable
Target: OpenSMTPD 6.4.0 - 6.6.1
No auth needed
Prerequisites: Network access to the target SMTP port · Valid recipient email address
devstral-2 · analyzed Feb 18, 2026 Full analysis →
nomisec WORKING POC 5 stars
by r0lh · poc
https://github.com/r0lh/CVE-2020-7247

This repository contains a functional Go-based exploit for CVE-2020-7247, which targets OpenSMTPD versions prior to 6.6.2. The exploit leverages a command injection vulnerability in the SMTP server to achieve remote code execution by sending a crafted MAIL FROM command followed by a reverse shell payload.

Classification
Working Poc 100%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: OpenSMTPD < 6.6.2
No auth needed
Prerequisites: Network access to the OpenSMTPD server on port 25 · A listener set up on the attacker's machine to receive the reverse shell
devstral-2 · analyzed Feb 18, 2026 Full analysis →
nomisec WORKING POC 4 stars
by superzerosec · remote
https://github.com/superzerosec/cve-2020-7247

This repository contains a functional Python exploit for CVE-2020-7247, targeting OpenSMTPD versions before 6.6.2. The exploit leverages improper input sanitization to inject shell commands via SMTP, achieving remote code execution.

Classification
Working Poc 95%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: OpenSMTPD < 6.6.2
No auth needed
Prerequisites: Network access to OpenSMTPD port (typically 25) · Python 3 with pwntools library
devstral-2 · analyzed Feb 18, 2026 Full analysis →
nomisec WORKING POC 2 stars
by presentdaypresenttime · poc
https://github.com/presentdaypresenttime/shai_hulud

This repository contains a functional Python-based worm that exploits CVE-2020-7247, a remote code execution vulnerability in OpenSMTPD 6.6.1. The exploit leverages a malformed 'MAIL FROM' command to execute arbitrary commands on vulnerable SMTP servers.

Classification
Working Poc 95%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: OpenSMTPD 6.6.1p1
No auth needed
Prerequisites: Network access to vulnerable OpenSMTPD server · Python environment with required libraries
devstral-2 · analyzed Feb 18, 2026 Full analysis →
nomisec WORKING POC 2 stars
by SimonSchoeni · remote
https://github.com/SimonSchoeni/CVE-2020-7247-POC

This repository contains a functional exploit for CVE-2020-7247, a command injection vulnerability in OpenSMTPD. The exploit leverages improper validation of email addresses in the `MAIL FROM` field to execute arbitrary commands via shell metacharacters.

Classification
Working Poc 100%
Attack Type
Rce
Complexity
Trivial
Reliability
Reliable
Target: OpenSMTPD 6.6.1
No auth needed
Prerequisites: Network access to OpenSMTPD port 25 · Python 3.x with pwntools
devstral-2 · analyzed Feb 18, 2026 Full analysis →
nomisec WORKING POC 2 stars
by f4T1H21 · remote
https://github.com/f4T1H21/CVE-2020-7247

This repository contains a functional exploit for CVE-2020-7247, a remote code execution vulnerability in OpenSMTPD versions 6.4.0 to 6.6.1. The exploit leverages a command injection flaw in the SMTP server's mail address parsing to execute arbitrary commands.

Classification
Working Poc 100%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: OpenSMTPD 6.4.0 < 6.6.1
No auth needed
Prerequisites: Network access to the OpenSMTPD server · Valid recipient email address on the target server
devstral-2 · analyzed Feb 18, 2026 Full analysis →
nomisec WORKING POC 1 stars
by minhluannguyen · remote
https://github.com/minhluannguyen/CVE-2020-7247-reproducer

This repository contains a functional exploit for CVE-2020-7247, demonstrating arbitrary command execution in OpenSMTPD via a crafted SMTP session. The exploit leverages command injection in the 'MAIL FROM' field to achieve remote code execution.

Classification
Working Poc 95%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: OpenSMTPD 6.6.1p1
No auth needed
Prerequisites: Network access to the SMTP port (25) · Vulnerable OpenSMTPD version
devstral-2 · analyzed Feb 18, 2026 Full analysis →
gitlab WORKING POC
by f4T1H21 · remote
https://gitlab.com/f4T1H21/CVE-2020-7247

This repository contains a functional exploit for CVE-2020-7247, targeting OpenSMTPD versions 6.4.0 to 6.6.1. The exploit leverages a command injection vulnerability in the SMTP server to achieve remote code execution by sending a crafted MAIL FROM command followed by a payload that triggers a reverse shell.

Classification
Working Poc 100%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: OpenSMTPD 6.4.0 < 6.6.1
No auth needed
Prerequisites: Network access to the OpenSMTPD server · Valid recipient email address on the target server
devstral-2 · analyzed Feb 23, 2026 Full analysis →
nomisec WORKING POC
by bytescrappers · remote
https://github.com/bytescrappers/CVE-2020-7247

This repository contains a functional exploit for CVE-2020-7247, targeting OpenSMTPD's 'smtp_mailaddr()' function. The exploit leverages a command injection vulnerability to achieve remote code execution (RCE) as root by sending a crafted SMTP payload.

Classification
Working Poc 95%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: OpenSMTPD on OpenBSD 6.6
No auth needed
Prerequisites: Network access to the target SMTP server · OpenSMTPD running on OpenBSD 6.6
devstral-2 · analyzed Feb 18, 2026 Full analysis →
vulncheck_xdb WORKING POC
remote
https://github.com/0xdea/exploits

This repository contains functional exploit code for CVE-2020-7247, targeting OpenBSD's OpenSMTPD for local privilege escalation (LPE) and remote code execution (RCE). The exploits are well-documented and include multiple PoCs for various platforms and vulnerabilities.

Classification
Working Poc 100%
Attack Type
Rce | Lpe
Complexity
Moderate
Reliability
Reliable
Target: OpenBSD OpenSMTPD
No auth needed
Prerequisites: Access to the target system · OpenSMTPD running on OpenBSD 6.4, 6.5, or 6.6
devstral-2 · analyzed Feb 25, 2026 Full analysis →
metasploit WORKING POC EXCELLENT
by Qualys, wvu · rubypocunix
https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/unix/smtp/opensmtpd_mail_from_rce.rb

This Metasploit module exploits a command injection vulnerability in OpenSMTPD's MAIL FROM field to achieve remote code execution as root. It uses a 'comment slide' technique to bypass input restrictions and deliver a payload via SMTP commands.

Classification
Working Poc 100%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: OpenSMTPD 6.4.0 - 6.6.1
No auth needed
Prerequisites: Network access to OpenSMTPD port (25) · Valid mail recipient
devstral-2 · analyzed Feb 16, 2026 Full analysis →

Nuclei Templates (1)

OpenSMTPD 6.4.0-6.6.1 - Remote Code Execution
CRITICALby princechaddha

References (15)

Core 15
Core References
Patch, Vendor Advisory x_refsource_confirm
https://www.openbsd.org/security.html
Exploit, Mailing List, Third Party Advisory x_refsource_misc
http://www.openwall.com/lists/oss-security/2020/01/28/3
Mailing List, Third Party Advisory mailing-list x_refsource_bugtraq
https://seclists.org/bugtraq/2020/Jan/51
Mailing List, Third Party Advisory vendor-advisory x_refsource_debian
https://www.debian.org/security/2020/dsa-4611
Exploit, Third Party Advisory, VDB Entry x_refsource_misc
http://packetstormsecurity.com/files/156145/OpenSMTPD-6.6.2-Remote-Code-Execution.html
Third Party Advisory, US Government Resource third-party-advisory x_refsource_cert-vn
https://www.kb.cert.org/vuls/id/390745
Exploit, Mailing List, Third Party Advisory mailing-list x_refsource_fulldisc
http://seclists.org/fulldisclosure/2020/Jan/49
Exploit, Third Party Advisory, VDB Entry x_refsource_misc
http://packetstormsecurity.com/files/156249/OpenSMTPD-MAIL-FROM-Remote-Code-Execution.html
Third Party Advisory vendor-advisory x_refsource_ubuntu
https://usn.ubuntu.com/4268-1/
Broken Link, Third Party Advisory, VDB Entry x_refsource_misc
http://packetstormsecurity.com/files/162093/OpenBSD-OpenSMTPD-6.6-Remote-Code-Execution.html

Scores

CVSS v3 9.8
EPSS 0.9411
EPSS Percentile 99.9%
Attack Vector NETWORK
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

CISA SSVC

Vulnrichment
Exploitation active
Automatable yes
Technical Impact total

Details

CISA KEV 2022-03-25
VulnCheck KEV 2022-03-25
InTheWild.io 2020-01-31
ENISA EUVD EUVD-2020-28374
CWE
CWE-78 CWE-755
Status published
Products (6)
canonical/ubuntu_linux 18.04
canonical/ubuntu_linux 19.10
debian/debian_linux 9.0
debian/debian_linux 10.0
fedoraproject/fedora 32
openbsd/opensmtpd 6.6
Published Jan 29, 2020
KEV Added Mar 25, 2022
Tracked Since Feb 18, 2026