GHSA-RJ6Q-J8XP-7532
Message serialization includes the Bcc and Resent-Bcc header fields, disclosing blind recipients to every recipient
Texto original en inglés · Ver en español
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-RJ6Q-J8XP-7532 divulgada · CVSS 5.3 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Impact
`Psl\Message\serialize()` copied every header field of a message into its output, including `Bcc` and `Resent-Bcc`. RFC 5322 section 3.6.3 defines `Bcc` as the recipients whose addresses are not to be revealed to the other recipients of the message, so these fields must not be transmitted as they are.
`Psl\SMTP\Client\Transport::send()` transmits the output of `serialize()` as the message data. The envelope built by `Psl\Message\Envelope::fromMessage()` delivers the message to the `Bcc` addresses, and the header section that every recipient received, `To` and `Cc` recipients included, carried the full `Bcc` list. Any recipient could read the address of every blind recipient by viewing the raw headers, and each blind recipient could see the others. No action is needed beyond receiving the message.
Applications are affected when they set blind recipients with `Message::withBcc()`, with a raw `Bcc` or `Resent-Bcc` header through `withHeader()`, or by re-sending a parsed message that carries those fields, and then send the message with `Psl\SMTP\Client\Transport` or transmit the output of `Psl\Message\serialize()` in any other way. Some mail servers remove `Bcc` fields on receipt, but that is server behavior PSL cannot rely on: a server that relays the header section as received delivers the blind recipient list to everyone. Messages without blind recipients are not affected.
The flaw discloses email addresses, which are personal data, and the fact that those people received the message. It does not disclose the message content to anyone who was not already a recipient.
Patches
Fixed in 6.4.0 https://github.com/php-standard-library/php-standard-library/releases/tag/6.4.0.
- `serialize()` leaves `Bcc` and `Resent-Bcc` header fields, matched case-insensitively, out of its output.
- The message object keeps those fields, and `Envelope::fromMessage()` still includes the `Bcc` recipients, so blind recipients still receive the message through the SMTP envelope.
- Because the serialized output no longer contains the blind recipients, derive the envelope from the message object, not from a parsed copy of the serialized output. A copy saved from `serialize()` output, for example in a Sent folder, no longer contains the `Bcc` field either.
Workarounds
Build the message that is sent without `withBcc()` and without a `Bcc` or `Resent-Bcc` header, and add the blind recipients to the SMTP envelope yourself:
$envelope = Message\Envelope::fromMessage($message);
$envelope = new Message\Envelope($envelope->sender, [...$envelope->recipients, ...$blindRecipients]);
$transport->send($envelope, $message);Here `$message` has no `Bcc` header and `$blindRecipients` is a list of `Psl\Message\Address\Mailbox` instances.
References
- RFC 5322 section 3.6.3 (destination address fields: `Bcc`)
- RFC 5322 section 3.6.6 (resent fields: `Resent-Bcc`)
- https://github.com/php-standard-library/php-standard-library/releases/tag/6.4.0
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/message |
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-rj6q-j8xp-7532Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
