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
directPathmust start with a single/. Anything else throws a 400. - A message
urlis used only if it points to an https*.whatsapp.netmedia host. Otherwise the download uses the default media host. When the message has nodirectPatheither, 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,CookieandProxy-Authorizationare not sent to a different host. - To download from your own host, pass the
hostoption. - 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 mismatchorMedia file is truncated or malformed. Range downloads (startByteorendByte) 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
dispatcherorproxyUrl, the address is checked before the request but not at connect time. - Custom
fetchOpts.headersare sent only to the origin the preview was requested for. Other origins, whether reached by a redirect or serving a thumbnail, get onlyaccept,accept-language,accept-encoding,user-agent,cache-controlandpragma.
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.