GHSA-GMCV-XVGQ-XJQG
SMTP transport ignores the requireTls option and silently sends messages without REQUIRETLS
Texto original en inglés · Ver en español
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-GMCV-XVGQ-XJQG divulgada · CVSS 6.5 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Impact
`Psl\SMTP\Client\SendConfiguration::$requireTls`, set with `withRequireTls(true)`, is documented as requiring TLS for the entire delivery chain (RFC 8689). `Psl\SMTP\Client\Transport::send()` did not enforce it:
- When the server did not advertise the `REQUIRETLS` extension, the transport sent the message anyway, without the `REQUIRETLS` parameter on `MAIL FROM`, and reported success.
- With `Security::None`, the transport sent the message over a plaintext connection, and added `REQUIRETLS` to it when the server advertised the extension there.
- When the transport reused a pooled connection, it lost the EHLO capabilities read when the connection was opened. The second and later messages sent on each connection therefore went out without `REQUIRETLS` even when the server advertised it. The same loss dropped the other negotiated extensions on reused connections (`SMTPUTF8`, `8BITMIME`, `MT-PRIORITY`, `DELIVERBY`, `FUTURERELEASE`, `PIPELINING` and `CHUNKING`).
Without `REQUIRETLS`, the receiving server and every later relay may deliver the message over plaintext, or over TLS without an authenticated certificate, which is the downgrade RFC 8689 exists to prevent. An attacker on the network path of a later hop, for example one who strips STARTTLS between two relays, can then read the message and modify it in transit. With `Security::None`, an attacker on the path to the first server can do the same. The application gets no error, so it treats the message as protected.
Applications are affected when they send with `Psl\SMTP\Client\Transport` and enable `requireTls`, which is off by default. Long-running processes that send several messages through one `Transport` hit the pooled-connection case even when their server supports `REQUIRETLS`. Exploitation needs a position on the network path of one of the delivery hops; an attacker cannot trigger the flaw remotely.
Patches
Fixed in 6.4.0 https://github.com/php-standard-library/php-standard-library/releases/tag/6.4.0.
- When `requireTls` is set, `send()` throws `TransmissionException` before `MAIL FROM` if the transport uses `Security::None` or the server does not advertise `REQUIRETLS`, as RFC 8689 sections 4.2.1 and 4.3 require; the message is not sent.
- The EHLO capabilities of a pooled connection are kept and restored when the connection is reused, so later sends keep `REQUIRETLS` and the other negotiated extensions.
Applications that set `requireTls` against a server without `REQUIRETLS` support now get an exception instead of a silent downgrade. Drop the option if delivery without it is acceptable.
Workarounds
There is no complete workaround. On 6.2.x and 6.3.x, these steps reduce the exposure:
- Do not combine `requireTls` with `Security::None`.
- Send each message that sets `requireTls` through a new `Transport` instance and close it afterwards, so the message goes out on a fresh connection whose EHLO capabilities are known.
- Only set `requireTls` with a submission server you have confirmed advertises `REQUIRETLS`. The transport still sends without it, and without an error, if the server stops advertising it.
References
- RFC 8689 (SMTP Require TLS Option), sections 4.2.1 (sending with TLS required) and 4.3 (REQUIRETLS submission)
- https://github.com/php-standard-library/php-standard-library/releases/tag/6.4.0
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Packagistphp-standard-library/smtp |
Corregida | 6.4.0 | — | — |
Packagistphp-standard-library/php-standard-library |
Corregida | 6.4.0 | — | — |
6.4.0Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/php-standard-library/php-standard-library/security/advisories/GHSA-gmcv-xvgq-xjqgLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
