The vulnerability is a CRLF injection in MimeKit, occurring when an email address with a quoted local-part is parsed. An attacker can craft a malicious email address containing CRLF sequences (e.g., "local\r\npart"@domain.com).
When an application uses MimeKit to create a MailboxAddress object from this malicious string, for instance, via new MailboxAddress("name", maliciousAddress), the MimeKit parser incorrectly accepts the illegal CRLF characters. This can be abused to inject arbitrary SMTP commands.
The root cause of the vulnerability is located in the MimeKit.InternetAddress.TryParseLocalPart function. Before the patch, this function utilized a generic and overly permissive utility function, ParseUtils.SkipQuoted, for parsing quoted strings. This utility did not validate and reject control characters like Carriage Return (CR) and Line Feed (LF), which are explicitly forbidden within the local-part of an email address by RFC 5321.
The patch rectifies this issue by replacing the call to ParseUtils.SkipQuoted with a new, stricter SkipQuoted method implemented directly within the InternetAddress.cs file. This new method correctly validates the characters inside the quoted string and throws a ParseException upon encountering any control characters, thereby preventing the CRLF injection.
During exploitation, a runtime profiler would capture the call to the MailboxAddress constructor, which is the public API entry point, followed by the internal call to MimeKit.InternetAddress.TryParseLocalPart, where the flawed parsing logic resides. Consequently, both of these functions are critical indicators that the vulnerability is being triggered.