CVE-2026-23829: 
NixOS vulnerability analysis and mitigation

Overview

CVE-2026-23829 is an SMTP Header Injection vulnerability in Mailpit, an email testing tool and API for developers, caused by insufficient regular expression validation of RCPT TO and MAIL FROM addresses. All versions up to and including 1.28.2 are affected; version 1.28.3 resolves the issue. The vulnerability was disclosed via GitHub Advisory GHSA-54wq-72mp-cq7c on January 17, 2026, and published to the NVD on January 19, 2026. It carries a CVSS v3.1 base score of 5.3 (Medium) (Github Advisory, Mailpit Advisory).

Technical details

The root cause lies in a flawed regex character class used in internal/smtpd/smtpd.go to validate SMTP envelope addresses (CWE-93, CWE-150). The regexes rcptToRE and mailFromRE use [^<>\v] intending to block vertical whitespace, but in Go's RE2 engine, \v inside a character class matches only the Vertical Tab (\x0B), not Carriage Return (\r, 0x0D) or Line Feed (\n, 0x0A). As a result, an attacker can include \r in a crafted RCPT TO or MAIL FROM address, which passes validation and is then embedded directly into the Received header via buffer.WriteString(fmt.Sprintf(" for <%s>; %s\r\n", to[0], now)), producing a "Bare CR" that corrupts the stored .eml file and can trigger full header injection in downstream mail clients. A public PoC Python script demonstrating the bare CR injection is included in the advisory (Mailpit Advisory, Github Advisory).

Impact

Successful exploitation allows an unauthenticated remote attacker to inject arbitrary SMTP headers into emails processed by Mailpit, corrupting stored .eml files and potentially enabling email spoofing and phishing attacks. While the Mailpit UI may render the bare CR as a space (masking the injection), downstream systems such as Outlook or older MTAs may interpret it as a line break, triggering full header injection. The vulnerability has no direct confidentiality or availability impact, but integrity is compromised through header manipulation; additionally, developers using Mailpit may receive a false sense of security if their applications generate malformed emails that pass Mailpit's validation but fail in production environments (Mailpit Advisory).

Exploitability

Multiple proof-of-concept exploits are publicly available, including two GitHub repositories attributed to SimoesCTT and the PoC script embedded in the official advisory (Github Advisory). A Nuclei detection template has also been added to the ProjectDiscovery nuclei-templates repository, enabling automated scanning. The EPSS score is approximately 0.038% per Feedly data, though the GitHub Advisory Database reports 1.594% (82nd percentile). There is no evidence of active in-the-wild exploitation as of the time of reporting, and the vulnerability is not listed in the CISA KEV catalog (Mailpit Advisory).

Exploitation steps

  1. Reconnaissance: Identify internet-accessible Mailpit SMTP server instances (default port 1025) using network scanners such as Shodan or Censys, targeting versions ≤ 1.28.2.
  2. Establish TCP connection: Connect directly to the Mailpit SMTP port using a raw socket or SMTP client (e.g., nc, Python socket).
  3. Initiate SMTP session: Send EHLO test.com\r\n and receive the server banner and capabilities.
  4. Send MAIL FROM: Issue a normal MAIL FROM:<attacker@example.com>\r\n command.
  5. Inject malicious RCPT TO: Send a crafted RCPT TO command embedding a bare CR in the address, e.g., RCPT TO:<victim\rINJECTED-HEADER: YES>\r\n. The server responds with 250 OK because the regex does not block \r.
  6. Complete the DATA phase: Send DATA\r\n, followed by email headers and body (e.g., Subject: Test\r\n\r\nBody\r\n.\r\n).
  7. Observe injection: The stored .eml file's Received header now contains the bare CR, creating a new line with the injected content. Downstream mail clients or MTAs that process the exported email may interpret the bare CR as a full line break, completing the header injection (Mailpit Advisory, Github Advisory).

Indicators of compromise

  • Network: Unexpected raw TCP connections to Mailpit's SMTP port (default 1025) from external or untrusted hosts; SMTP sessions containing non-printable characters (e.g., 0x0D bare CR, 0x00 null byte) in RCPT TO or MAIL FROM arguments.
  • Logs: SMTP server logs showing RCPT TO or MAIL FROM commands with unusual or non-ASCII characters in the address field; 250 OK responses to addresses containing control characters.
  • File System: Stored .eml files in the Mailpit data directory containing bare CR (\r) characters within the Received header line, visible when inspecting raw file content with a hex editor or cat -A; malformed To: fields showing empty or truncated addresses (indicative of null byte injection).
  • Application Behavior: Mailpit API returning empty [] for the To field in message summaries, which may indicate null byte injection in the recipient address (Mailpit Advisory).

Mitigation and workarounds

Upgrade Mailpit to version 1.28.3 or later, which fixes the vulnerability by replacing the flawed regex-based validation with Go's net/mail.ParseAddress() function to enforce RFC 5322 compliance on all RCPT TO and MAIL FROM addresses (Mailpit Release, Patch Commit). If immediate patching is not possible, restrict network access to the Mailpit SMTP port (default 1025) to trusted hosts only using firewall rules or network segmentation. Review SMTP logs for any addresses containing control characters as a precautionary measure.

Community reactions

The vulnerability was responsibly disclosed by security researcher omarkurt and acknowledged by the Mailpit maintainer, who credited both omarkurt and mdisec in the v1.28.3 release notes (Mailpit Release). The issue received coverage on dev.to and cvereports.com, and a Nuclei detection template was contributed to the ProjectDiscovery community templates repository, reflecting active interest from the security scanning community (Github Advisory).

Additional resources


Source: This report was generated using AI

Related NixOS vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-116199CRITICAL9.2
  • NixOS logoNixOS
  • cpe:2.3:a:snipeitapp:snipe-it
NoYesOct 25, 2026
CVE-2026-116201HIGH8.7
  • NixOS logoNixOS
  • cpe:2.3:a:snipeitapp:snipe-it
NoYesOct 25, 2026
CVE-2026-116200HIGH8.2
  • NixOS logoNixOS
  • cpe:2.3:a:snipeitapp:snipe-it
NoYesOct 25, 2026
CVE-2026-2270MEDIUM5.9
  • NixOS logoNixOS
  • kubernetes
NoYesOct 26, 2026
CVE-2026-76654MEDIUM5.8
  • NixOS logoNixOS
  • cpe:2.3:a:kubernetes:kubernetes
NoYesOct 26, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management