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-2021-38371

CVE-2021-38371: Exim STARTTLS Response Injection Flaw

CVE-2021-38371 is a response injection vulnerability in Exim's STARTTLS feature that allows attackers to inject malicious responses during SMTP sending. This article covers technical details, affected versions, and mitigation.

Published: February 25, 2026

CVE-2021-38371 Overview

CVE-2021-38371 is a response injection vulnerability affecting the STARTTLS feature in the Exim mail transfer agent (MTA) through version 4.94.2. This flaw allows attackers to exploit improper buffering during SMTP STARTTLS negotiation, enabling injection of arbitrary responses during MTA SMTP sending operations. The vulnerability undermines the security guarantees expected from TLS-encrypted email communications.

Critical Impact

Attackers can inject malicious responses during the STARTTLS negotiation phase, potentially compromising the integrity of email communications and enabling man-in-the-middle style attacks on mail servers.

Affected Products

  • Exim through version 4.94.2
  • All Exim MTA deployments utilizing STARTTLS functionality
  • Systems running vulnerable Exim versions with SMTP relay capabilities

Discovery Timeline

  • 2021-08-10 - CVE-2021-38371 published to NVD
  • 2025-11-03 - Last updated in NVD database

Technical Details for CVE-2021-38371

Vulnerability Analysis

This vulnerability is classified under CWE-74 (Improper Neutralization of Special Elements in Output Used by a Downstream Component), commonly known as injection. The flaw exists in how Exim handles the transition from plaintext to encrypted communication during the STARTTLS protocol handshake.

When an Exim server initiates an outbound SMTP connection and requests TLS encryption via STARTTLS, the vulnerable implementation fails to properly clear or handle buffered data. This creates a window where a malicious intermediary or compromised server can inject arbitrary SMTP responses that will be processed after the TLS handshake completes, effectively poisoning the encrypted session with pre-injected commands.

The attack surface is network-based and requires no authentication or user interaction. A successful exploit could allow an attacker to manipulate email routing, inject false server responses, or subvert the security properties that TLS is meant to provide.

Root Cause

The root cause of CVE-2021-38371 lies in improper input buffer management during the STARTTLS protocol transition. When Exim sends the STARTTLS command and awaits a response, the implementation does not adequately sanitize or discard any data that may have been buffered before the TLS session begins. This buffering issue allows pre-TLS injected data to be interpreted as legitimate post-TLS server responses.

The vulnerability is part of a broader class of STARTTLS implementation weaknesses documented by security researchers studying opportunistic encryption in email protocols. The fundamental design flaw is treating the plaintext and encrypted portions of the connection as a continuous trusted stream rather than distinct security contexts.

Attack Vector

The attack vector for this vulnerability involves a network-positioned adversary who can intercept or modify SMTP traffic between an Exim MTA and a remote mail server. The attack proceeds as follows:

The attacker positions themselves between the Exim server and its intended destination, commonly through DNS spoofing, BGP hijacking, or local network compromise. When Exim initiates an outbound SMTP connection and sends the STARTTLS command, the attacker's system responds with a valid 220 Ready to start TLS response, followed by additional injected SMTP responses that are buffered by Exim.

Upon TLS negotiation completing, Exim processes the buffered responses as if they came through the encrypted channel. These injected responses could include fake acknowledgments, redirects, or other SMTP protocol elements that alter the behavior of the mail transfer. For detailed technical information, see the NoStartTLS Security Resource which documents this class of vulnerabilities across multiple email implementations.

Detection Methods for CVE-2021-38371

Indicators of Compromise

  • Unexpected SMTP response sequences in mail server logs, particularly during STARTTLS negotiation
  • Anomalous buffered data detected in SMTP connection handling
  • Email routing inconsistencies or unexplained delivery failures
  • TLS handshake timing anomalies that suggest injection attempts

Detection Strategies

  • Monitor Exim mail logs for unusual STARTTLS response patterns or unexpected multi-line responses
  • Implement network-level inspection for SMTP traffic anomalies during TLS upgrade sequences
  • Deploy SentinelOne Singularity to detect exploitation attempts targeting mail infrastructure
  • Configure alerting for Exim processes exhibiting abnormal network communication patterns

Monitoring Recommendations

  • Enable verbose SMTP logging on Exim servers to capture full protocol exchanges
  • Implement SMTP protocol validation at network perimeter to detect injection attempts
  • Monitor for certificate validation failures or unexpected TLS negotiation behaviors
  • Track Exim version deployments across the organization for vulnerability management

How to Mitigate CVE-2021-38371

Immediate Actions Required

  • Upgrade Exim to the latest version that addresses the STARTTLS buffering vulnerability
  • Review mail server configurations and disable opportunistic STARTTLS where strict TLS is preferred
  • Implement DANE (DNS-based Authentication of Named Entities) to strengthen TLS validation
  • Audit outbound SMTP connections for any signs of tampering or injection

Patch Information

Exim has released a security advisory addressing CVE-2021-38371. Organizations should consult the official Exim security advisory for specific patching guidance and version information. Debian-based systems should also review the Debian LTS Announcement for distribution-specific updates.

Administrators should verify their Exim version using exim -bV and compare against patched versions documented in the vendor advisory. The fix involves proper clearing of input buffers during the STARTTLS state transition.

Workarounds

  • Configure Exim to require TLS for all connections using hosts_require_tls directives, eliminating STARTTLS negotiation
  • Disable STARTTLS entirely and use implicit TLS on port 465 where supported
  • Implement network segmentation to limit exposure of mail servers to potential attackers
  • Use VPN or dedicated secure links between mail servers under your control
bash
# Exim configuration to enforce mandatory TLS
# Add to exim.conf to mitigate STARTTLS vulnerabilities
tls_advertise_hosts = *
tls_require_ciphers = ${if def:tls_out_cipher {HIGH:!aNULL:!MD5:!RC4}}
hosts_require_tls = *

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

  • Vulnerability Details
  • TypeXSS

  • Vendor/TechExim

  • SeverityHIGH

  • CVSS Score7.5

  • EPSS Probability2.21%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-74
  • Technical References
  • NoStartTLS Security Resource

  • Exim Official Website

  • Debian LTS Announcement
  • Vendor Resources
  • CVE-2021-38371 Security Advisory
  • Related CVEs
  • CVE-2025-67896: Exim Buffer Overflow Vulnerability

  • CVE-2025-26794: Exim Mail Server SQLi Vulnerability

  • CVE-2023-42116: Exim SMTP Buffer Overflow RCE Vulnerability

  • CVE-2023-42114: Exim NTLM Information Disclosure Flaw
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