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
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • 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-2026-23829

CVE-2026-23829: Mailpit SMTP Header Injection Vulnerability

CVE-2026-23829 is a header injection vulnerability in Mailpit's SMTP server allowing attackers to inject arbitrary headers via carriage return characters. This post covers the technical details, affected versions, and mitigation.

Published: January 23, 2026

CVE-2026-23829 Overview

Mailpit, an email testing tool and API for developers, contains an SMTP Header Injection vulnerability in versions prior to 1.28.3. The vulnerability exists due to an insufficient Regular Expression used to validate RCPT TO and MAIL FROM addresses in Mailpit's SMTP server. An attacker can inject arbitrary SMTP headers or corrupt existing ones by including carriage return characters (\r) in the email address.

This header injection occurs because the regex intended to filter control characters fails to exclude \r and \n when used inside a character class. This flaw allows network-based attackers to manipulate SMTP headers without authentication, potentially enabling email spoofing, spam relay abuse, or bypassing email security controls.

Critical Impact

Attackers can inject arbitrary SMTP headers by exploiting insufficient regex validation in email address parsing, potentially enabling email spoofing and header manipulation attacks.

Affected Products

  • Mailpit versions prior to 1.28.3
  • Mailpit SMTP server component

Discovery Timeline

  • 2026-01-19 - CVE CVE-2026-23829 published to NVD
  • 2026-01-19 - Last updated in NVD database

Technical Details for CVE-2026-23829

Vulnerability Analysis

The vulnerability is classified under CWE-93 (Improper Neutralization of CRLF Sequences - 'CRLF Injection'). The root cause lies in Mailpit's SMTP server implementation within the internal/smtpd/smtpd.go file, where email address validation relies on a flawed regular expression pattern.

The regex pattern used to validate RCPT TO and MAIL FROM addresses was designed to filter control characters but fails to properly handle carriage return (\r) and newline (\n) characters when they appear inside a character class. This oversight allows attackers to bypass the validation and inject CRLF sequences directly into email addresses.

By exploiting this vulnerability, an attacker can craft malicious email addresses containing carriage return characters that, when processed by the SMTP server, result in additional headers being injected into the email message. This can lead to email spoofing, manipulation of email routing, or exploitation of downstream email processing systems.

Root Cause

The vulnerability stems from improper input validation in the SMTP address parsing logic. The regular expression character class used to filter dangerous characters did not properly escape or exclude CRLF sequences (\r\n), allowing these control characters to pass through validation. This is a common pitfall when regex patterns are not thoroughly tested against all possible control character inputs.

Attack Vector

The attack vector is network-based and requires no authentication or user interaction. An attacker can connect to an exposed Mailpit SMTP server and send specially crafted MAIL FROM or RCPT TO commands containing carriage return characters embedded in the email address field.

When the server processes these commands, the injected CRLF sequences cause the parser to interpret subsequent data as new SMTP headers rather than part of the email address. This allows the attacker to inject arbitrary headers such as BCC, CC, Subject, or custom headers that may be trusted by downstream systems.

The security patch addresses this vulnerability by implementing RFC 5322 compliant address validation:

go
 	"io/fs"
 	"log"
 	"net"
+	"net/mail"
 	"os"
 	"regexp"
 	"strconv"

Source: GitHub Commit Update

The fix imports Go's net/mail package to ensure that SMTP TO and FROM addresses are validated against RFC 5322 standards, properly rejecting addresses containing control characters.

Detection Methods for CVE-2026-23829

Indicators of Compromise

  • SMTP server logs showing email addresses containing carriage return (\r) or newline (\n) characters
  • Unusual SMTP MAIL FROM or RCPT TO commands with embedded control characters
  • Emails with unexpected or duplicate headers that weren't set by the original sender
  • Network traffic containing malformed SMTP commands with encoded CRLF sequences (%0d%0a or \r\n)

Detection Strategies

  • Monitor SMTP server logs for addresses containing non-printable or control characters
  • Implement network intrusion detection rules to flag SMTP commands with CRLF sequences in address fields
  • Review outbound email headers for signs of injection such as duplicate From, To, or unexpected custom headers
  • Deploy application-level monitoring to detect regex bypass attempts in email address validation

Monitoring Recommendations

  • Enable verbose logging on Mailpit SMTP server to capture full command details
  • Set up alerts for SMTP commands containing hex-encoded control characters (%0d, %0a)
  • Monitor for unusual email routing patterns that may indicate successful header injection
  • Review email gateway logs for messages with malformed or suspicious header structures

How to Mitigate CVE-2026-23829

Immediate Actions Required

  • Upgrade Mailpit to version 1.28.3 or later immediately
  • Restrict network access to Mailpit SMTP server to trusted development networks only
  • Review recent SMTP logs for signs of exploitation attempts
  • Ensure Mailpit is not exposed to untrusted networks or the public internet

Patch Information

The vulnerability has been fixed in Mailpit version 1.28.3. The patch implements RFC 5322 compliant address validation using Go's net/mail package, ensuring that SMTP TO and FROM addresses properly reject control characters including carriage returns and newlines.

Patch resources:

  • GitHub Release v1.28.3
  • GitHub Security Advisory GHSA-54wq-72mp-cq7c
  • GitHub Commit Update

Workarounds

  • Isolate Mailpit instances to internal development networks only, blocking external SMTP access
  • Implement network-level filtering to reject SMTP commands containing encoded CRLF sequences
  • Deploy a reverse proxy or SMTP gateway with strict input validation in front of Mailpit
  • Use firewall rules to whitelist only known development machine IPs that require SMTP access
bash
# Configuration example - Restrict Mailpit SMTP to localhost only
mailpit --smtp-bind-addr 127.0.0.1:1025

# Alternative: Use firewall to restrict access
iptables -A INPUT -p tcp --dport 1025 -s 192.168.1.0/24 -j ACCEPT
iptables -A INPUT -p tcp --dport 1025 -j DROP

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

  • Vulnerability Details
  • TypeOther

  • Vendor/TechMailpit

  • SeverityMEDIUM

  • CVSS Score5.3

  • EPSS Probability0.04%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-93
  • Technical References
  • GitHub Commit Update

  • GitHub Release v1.28.3

  • GitHub Security Advisory GHSA-54wq-72mp-cq7c
  • Related CVEs
  • CVE-2026-22689: Mailpit WebSocket Hijacking Vulnerability

  • CVE-2026-27808: Mailpit Link Check API SSRF Vulnerability

  • CVE-2026-23845: Mailpit SSRF Vulnerability

  • CVE-2026-21859: Mailpit Email Testing Tool SSRF 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