llamaCVEVulnerability Intelligence
/
Advisory · GitHub · crates.io · lettre

GHSA-23WM-4VVW-R7P2

SMTP transport panics on an EHLO reply line consisting only of whitespace

Sin parche publicado
Descargar PNG JSON
CVSS
—
low
Fuente: —
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
ParcheSin parcheEl fabricante no ha publicado corrección
Exposición2 dDesde la divulgación, 17 nov 2026, 11:56 a. m.
Detección1 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Modificada
Explotación
Remediación
Monitoreo
Detectada +1
11:56 a. m.
12:06 p. m.
01:05 a. m.
12:53 a. m.
11:56 a. m.
03:10 a. m.
06:25 p. m.
09:39 a. m.
12:53 a. m.
FechaFaseEventoDetalle
Divulgación Publicada GHSA-23WM-4VVW-R7P2 divulgada
Divulgación Modificada Última actualización del registro
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés
Summary

`ServerInfo::from_response` (src/transport/smtp/extension.rs) panics when a line of the EHLO reply is non-empty but consists only of whitespace. The line passes the `line.is_empty()` check, and `line.split_whitespace().next().unwrap()` then unwraps `None`.

The EHLO reply comes from the network peer. Before STARTTLS (or on a plaintext connection) it is unauthenticated, so besides a malicious server, anyone on the path can trigger the panic.

Details
for line in response.message() {
    if line.is_empty() {
        continue;
    }

    let mut split = line.split_whitespace();
    match split.next().unwrap() {   // None for "   "

A reply such as `250-mail.example\r\n250 \r\r\n` parses into the lines `["mail.example", "\r"]` (or other whitespace-only text), which reaches the `unwrap()`.

PoC
use lettre::transport::smtp::{extension::ServerInfo, response::Response};

let response: Response = "250-mail.example\r\n250 \r\r\n".parse().unwrap();
ServerInfo::from_response(&response); // panics: called `Option::unwrap()` on a `None` value

Found by fuzzing `Response` parsing + `ServerInfo::from_response` with cargo-fuzz (libFuzzer). Reproduced on 0.11.22, 0.11.23 and current master (94b63ac).

Impact

Denial of service of the sending task: with the default `panic = "unwind"` the task sending the email (e.g. a tokio task using `AsyncSmtpTransport`) is aborted and remaining messages are not sent; with `panic = "abort"` the whole process terminates. No memory-safety impact.

Suggested fix

Skip whitespace-only lines the same way as empty ones (patch below, with a regression test). We are happy to open a PR once you are ready.

diff --git a/src/transport/smtp/extension.rs b/src/transport/smtp/extension.rs
index ff5b4c4..a541ac3 100644
--- a/src/transport/smtp/extension.rs
+++ b/src/transport/smtp/extension.rs
@@ -136,12 +136,12 @@ impl ServerInfo {
         let mut features: HashSet<Extension> = HashSet::new();
 
         for line in response.message() {
-            if line.is_empty() {
+            let mut split = line.split_whitespace();
+            let Some(keyword) = split.next() else {
                 continue;
-            }
+            };
 
-            let mut split = line.split_whitespace();
-            match split.next().unwrap() {
+            match keyword {
                 "8BITMIME" => {
                     features.insert(Extension::EightBitMime);
                 }
@@ -412,4 +412,14 @@ mod test {
         assert!(server_info2.supports_auth_mechanism(Mechanism::Plain));
         assert!(!server_info2.supports_feature(Extension::StartTls));
     }
+
+    #[test]
+    fn test_serverinfo_whitespace_only_line() {
+        let response: Response = "250-mail.example\r\n250 \r\r\n".parse().unwrap();
+
+        let server_info = ServerInfo::from_response(&response).unwrap();
+
+        assert_eq!(server_info.name(), "mail.example");
+        assert!(server_info.features.is_empty());
+    }
 }

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

Versiones

Rangos afectados

Afectada Corregida Última
lettre≥ 0.10.0 ≤ 0.11.23
0.10.0
0.11.23
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
crates.iolettre
Sin parche — — 0.11.23 afectada
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/lettre/lettre/security/advisories/GHSA-23wm-4vvw-r7p2

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.