VYPR
Medium severity6.5NVD Advisory· Published Apr 24, 2026· Updated Apr 25, 2026

CVE-2026-41319

CVE-2026-41319

Description

MailKit is a cross-platform mail client library built on top of MimeKit. A STARTTLS Response Injection vulnerability in versions prior to 4.16.0 allows a Man-in-the-Middle attacker to inject arbitrary protocol responses across the plaintext-to-TLS trust boundary, enabling SASL authentication mechanism downgrade (e.g., forcing PLAIN instead of SCRAM-SHA-256). The internal read buffer in SmtpStream, ImapStream, and Pop3Stream is not flushed when the underlying stream is replaced with SslStream during STARTTLS upgrade, causing pre-TLS attacker-injected data to be processed as trusted post-TLS responses. Version 4.16.0 patches the issue.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

MailKit before 4.16.0 doesn't flush its read buffer during STARTTLS upgrade, letting a MitM inject pre-TLS response data to downgrade SASL authentication.

Root

Cause MailKit versions prior to 4.16.0 contain a STARTTLS Response Injection vulnerability (CVE-2026-41319) in the SmtpStream, ImapStream, and Pop3Stream classes. The Stream property is a simple auto-property that does not reset the internal read buffer when the underlying stream is replaced with SslStream during a STARTTLS upgrade [3]. This means any data that a Man-in-the-Middle attacker injects after the 220 Ready response (still within the same TCP segment) remains in the buffer and is not discarded when TLS negotiation begins.

Exploitation

A MitM attacker positioned between the MailKit client and the real server can append crafted protocol responses after the legitimate STARTTLS success response (e.g., 220 Ready) [2][3]. The client reads the 220 Ready line from its internal buffer, then replaces the plaintext stream with a TLS stream — but does not clear any remaining buffered data. When the client later issues an EHLO command (or equivalent in IMAP/POP3), ReadResponse() finds the injected data already in the buffer and processes it as if it came over the authenticated TLS channel [3]. No authentication is required for this attack; the attacker only needs to be in a position to intercept and modify network traffic before TLS is established.

Impact

By injecting a fake capability response, the attacker can force the client to downgrade its SASL authentication mechanism. For example, the server may offer SCRAM-SHA-256-* mechanisms, but the injected data can list only PLAIN, causing the client to send credentials in cleartext even though TLS was supposedly active [2][3]. This compromises authentication secrets and enables credential theft.

Mitigation

The vulnerability is fixed in MailKit version 4.16.0 [2][3]. Users should upgrade immediately. There is no known workaround. This vulnerability class is similar to earlier issues in Thunderbird (CVE-2021-23993), Dovecot (CVE-2021-33515), and Postfix (CVE-2011-0411) [3].

AI Insight generated on May 18, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
MailKitNuGet
< 4.16.04.16.0

Affected products

1

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

3

News mentions

0

No linked articles in our index yet.