Skip to content

v7.0.2

Latest

Choose a tag to compare

@github-actions github-actions released this 04 Dec 16:53

7.0.2 is a security release. Please upgrade.

Security advisories

Advisory Severity Summary
GHSA-xq6x-f65q-gm4j High Noise handshake accepts server certificates that are not signed by WhatsApp
GHSA-mchp-4q3r-rw7m High Retry receipts can make an account re-send messages it received, as its own
GHSA-mpch-h3qj-2v56 High Remotely triggerable process crashes from media downloads and malformed stanzas
GHSA-j837-5w38-8ccf Medium Media downloads go to a host chosen by the message sender, and the media MAC is not checked
GHSA-cwvh-p3gm-x27q Medium Server-side request forgery through link previews
GHSA-6v5f-rv4q-qmqr Low Sender key group ids can write auth files outside the auth folder on Windows

This release also requires libsignal 6.0.1. That version stops libsignal from logging session key material (GHSA-26m9-5cgg-jg63).

Behavior changes

Mock or test servers. The handshake now verifies the server's full certificate chain against WhatsApp's root key. To test against your own server, pass its root key as noiseCertificateRoot: { publicKey, serial? } in the socket config. Without it, the handshake fails for any server whose certificate is not signed by WhatsApp's root.

Media downloads.

  • A directPath must start with a single /. Anything else throws a 400.
  • A message url is used only if it points to an https *.whatsapp.net media host. Otherwise the download uses the default media host. When the message has no directPath either, the download is refused.
  • Redirects are followed only over https, to the same host or another WhatsApp media host, for at most 5 hops. A redirect anywhere else throws Media redirect is not allowed. Authorization, Cookie and Proxy-Authorization are not sent to a different host.
  • To download from your own host, pass the host option.
  • If the connection drops mid-download, the returned stream now emits an error. Before, the process crashed.

Media MAC.

  • Full downloads now check the media MAC. A failed check throws Media MAC mismatch or Media file is truncated or malformed. Range downloads (startByte or endByte) cannot be checked.
  • Decrypted data streams out before the MAC has been checked. If you consume the stream directly, treat the data as untrusted until the stream ends without an error. downloadMediaMessage(..., 'buffer') already handles this.

Link previews.

  • URLs that resolve to loopback, private, link-local or other non-public addresses get no preview. The address is checked again at connect time, and on every redirect (up to 5 hops).
  • Previews need local DNS. With a custom dispatcher or proxyUrl, the address is checked before the request but not at connect time.
  • Custom fetchOpts.headers are sent only to the origin the preview was requested for. Other origins, whether reached by a redirect or serving a thumbnail, get only accept, accept-language, accept-encoding, user-agent, cache-control and pragma.

Retry receipts. The socket now answers a retry receipt only with a message this device sent itself, taken from the send cache or from getMessage. If your getMessage also returns messages you received, filter on key.fromMe.

Stanza handlers. An error in one stanza handler, sync or async, is logged and no longer stops the socket. The same stanza still reaches its other handlers. A frame that cannot be decoded still ends the connection.

Multi-file auth state. Key ids with / or \ are written as __, and : as -, so every file stays inside the auth folder.

Thanks to P. Cunha, N. Weinberger, R. Linhares and S. Pundir, who reported vulnerabilities to us privately. 7.0.2 and libsignal 6.0.1 fix what they found, and the advisories are now public. We know some of you waited far too long for a fix, and we're sorry about that.

We're committed to keeping Baileys secure. We're also looking into modern cyber defense tools for the project.

Private vulnerability reporting is now turned on in the repo. If you find something, please report it there: https://github.com/WhiskeySockets/Baileys/security/advisories/new