The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2020-7247

CVE-2020-7247: OpenBSD OpenSMTPD RCE Vulnerability

CVE-2020-7247 is a remote code execution vulnerability in OpenSMTPD 6.6 that allows attackers to execute arbitrary commands as root via crafted SMTP sessions. This post covers technical details, affected versions, and mitigation.

Published: March 11, 2026

CVE-2020-7247 Overview

CVE-2020-7247 is a critical command injection vulnerability in the smtp_mailaddr function within smtp_session.c in OpenSMTPD 6.6. This vulnerability allows remote attackers to execute arbitrary commands as root via a crafted SMTP session by injecting shell metacharacters in the MAIL FROM field. The vulnerability affects the default "uncommented" configuration and exists due to an incorrect return value upon failure of input validation.

This vulnerability is particularly dangerous because it allows unauthenticated remote attackers to gain root-level access to affected mail servers through a simple SMTP session. The flaw has been actively exploited in the wild and is listed in CISA's Known Exploited Vulnerabilities catalog.

Critical Impact

Remote unauthenticated attackers can execute arbitrary commands with root privileges via crafted SMTP MAIL FROM commands, leading to complete system compromise.

Affected Products

  • OpenBSD OpenSMTPD 6.6
  • Debian Linux 9.0 and 10.0
  • Fedora 32
  • Canonical Ubuntu Linux 18.04 LTS and 19.10

Discovery Timeline

  • 2020-01-29 - CVE-2020-7247 published to NVD
  • 2025-11-07 - Last updated in NVD database

Technical Details for CVE-2020-7247

Vulnerability Analysis

The vulnerability resides in the smtp_mailaddr function in smtp_session.c, which is responsible for validating and processing email addresses in SMTP MAIL FROM commands. The core issue stems from improper handling of the return value when input validation fails, allowing specially crafted input containing shell metacharacters to bypass security checks.

When an attacker sends a MAIL FROM command with embedded shell metacharacters, the validation function incorrectly returns a value that allows the malicious input to proceed through the mail processing pipeline. This input eventually reaches a point where it is executed in a shell context with root privileges, as OpenSMTPD typically runs with elevated permissions to bind to privileged ports and manage mail delivery.

The vulnerability is classified under CWE-78 (OS Command Injection) and CWE-755 (Improper Handling of Exceptional Conditions), reflecting both the injection nature and the underlying validation failure.

Root Cause

The root cause is an incorrect return value in the smtp_mailaddr function when input validation fails. Instead of properly rejecting malformed or malicious input containing shell metacharacters, the function returns a value that allows processing to continue. This improper error handling creates a pathway for command injection through the MAIL FROM field, which is subsequently executed with root privileges during mail processing operations.

Attack Vector

The attack is network-based and requires no authentication or user interaction. An attacker can exploit this vulnerability by:

  1. Establishing an SMTP connection to a vulnerable OpenSMTPD server on port 25
  2. Sending a crafted MAIL FROM command containing shell metacharacters
  3. The malicious payload bypasses input validation due to the incorrect return value
  4. Commands embedded in the MAIL FROM field are executed with root privileges

The following patch addresses the vulnerability by correcting the input validation logic:

c
-/*	$OpenBSD: smtp_session.c,v 1.421 2020/01/08 00:05:38 gilles Exp $	*/
+/*	$OpenBSD: smtp_session.c,v 1.422 2020/01/28 21:35:00 gilles Exp $	*/
 
 /*
  * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>

Source: GitHub OpenBSD Commit

Detection Methods for CVE-2020-7247

Indicators of Compromise

  • Unusual SMTP MAIL FROM commands containing shell metacharacters such as ;, |, $(), or backticks in mail server logs
  • Unexpected processes spawned by the smtpd service running as root
  • Evidence of shell command execution in mail queue or delivery logs
  • Network connections originating from the SMTP daemon to unexpected destinations

Detection Strategies

  • Monitor SMTP traffic for MAIL FROM commands containing shell metacharacters or command injection patterns
  • Implement intrusion detection rules to flag SMTP sessions with unusual envelope sender formats
  • Review OpenSMTPD logs for rejected or malformed MAIL FROM commands that may indicate reconnaissance activity
  • Deploy behavioral analysis to detect anomalous process execution by the smtpd daemon

Monitoring Recommendations

  • Enable verbose logging for OpenSMTPD to capture all MAIL FROM commands received
  • Configure SIEM alerts for shell metacharacter patterns in SMTP envelope data
  • Monitor for privilege escalation or lateral movement following SMTP-related process activity
  • Audit system logs for unexpected root-level command execution correlated with SMTP activity

How to Mitigate CVE-2020-7247

Immediate Actions Required

  • Upgrade OpenSMTPD to version 6.6.2p1 or later immediately
  • If immediate patching is not possible, temporarily disable or restrict access to OpenSMTPD
  • Review system logs for evidence of exploitation attempts or successful compromise
  • Conduct a security assessment of systems running vulnerable OpenSMTPD versions

Patch Information

OpenBSD has released a security patch to address this vulnerability. The fix corrects the input validation logic in smtp_mailaddr to properly handle malformed input and return appropriate error values. Organizations should apply the patch available from the OpenBSD Security Page or upgrade to OpenSMTPD 6.6.2p1 or later.

Distribution-specific patches are available:

  • Debian Security Advisory DSA-4611
  • Ubuntu Security Notice USN-4268-1
  • Fedora Package Announcement

Workarounds

  • Restrict network access to the SMTP port (25) using firewall rules to limit exposure to trusted networks only
  • Implement network-level filtering to block SMTP connections containing suspicious metacharacters
  • Consider temporarily switching to an alternative MTA if patching cannot be performed immediately
  • Deploy a reverse proxy or mail relay in front of OpenSMTPD to sanitize incoming SMTP commands
bash
# Restrict SMTP access to trusted networks via iptables
iptables -A INPUT -p tcp --dport 25 -s 10.0.0.0/8 -j ACCEPT
iptables -A INPUT -p tcp --dport 25 -j DROP

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechOpensmtpd

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability94.08%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CISA KEV Information
  • In CISA KEVYes
  • CWE References
  • CWE-78

  • CWE-755
  • Technical References
  • Packet Storm Privilege Escalation

  • Packet Storm Remote Code Execution

  • Packet Storm Remote Code Execution

  • Packet Storm Local Privilege Escalation

  • Packet Storm Remote Code Execution

  • Full Disclosure Security Newsletter

  • OpenWall OSS Security Discussion

  • Fedora Package Announcement

  • Bugtraq Security Discussion

  • Ubuntu Security Notice

  • Debian Security Advisory

  • CERT Vulnerability Database Entry

  • CISA Known Exploited Vulnerability Catalog
  • Vendor Resources
  • GitHub OpenBSD Commit

  • OpenBSD Security Page
  • Related CVEs
  • CVE-2020-8794: OpenSMTPD Remote Code Execution Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English