Safeguard
Developer Tools•

Can the push service read your web push notifications?

Web push messages are encrypted so the push service cannot read them, but timing and size still leak. Here is what RFC 8291 protects and what it does not.

Safeguard Security Team
3 min read

Not if you encrypt as RFC 8291 specifies. The scheme protects message content from inspection, modification and forgery by the push service. It does not hide metadata: the push service still sees when you send and how long the message is, unless you pad.

Definition

Message Encryption for Web Push, RFC 8291, defines how your server encrypts a payload so only the subscribed browser can read it. The push service relays ciphertext. This matters because RFC 8030 notes that keeping the push URL secret does not hide message content from the push service.

How the keys work

Each browser creates an elliptic curve key pair on P-256 and a random authentication secret for every subscription. The RFC requires the secret to be a hard-to-guess sequence of 16 octets. Your server uses these, plus its own key, to derive the encryption key with HKDF and SHA-256, and encrypts with the aes128gcm content coding.

The authentication secret must reach your server over an authenticated, confidentiality-protected channel. If it leaks, outsiders could forge messages the browser would accept. Handle it like the endpoint itself. See web push URLs as secrets.

What it protects and what it does not

PropertyProtected?
Message content from the push serviceYes
Modification or forgery by the push serviceYes
Timing of the messageNo
Message lengthNot unless you add padding
Who the sender isVisible to the push service, especially if you use VAPID

The RFC states that timing and length of communication cannot be hidden from the push service, and that padding can obscure length only if used.

Practical limits

A push service is not required to support more than 4096 octets of payload body. After the header, minimum padding and authentication tag, the RFC puts the maximum plaintext at 3993 octets. Keep notifications short. That is also a privacy habit: send an identifier and let the app fetch the detail after the user opens it, so sensitive text does not sit in a notification.

The RFC also bans other content encodings to avoid compression based leaks, and requires receivers to discard messages whose padding delimiter is wrong.

Steps

  1. Use a maintained library that implements RFC 8291 rather than writing the crypto yourself.
  2. Store the auth secret and public key with the subscription, protected like a credential.
  3. Validate that the browser public key is on the P-256 curve, as the RFC requires.
  4. Keep payloads small and put sensitive detail behind an authenticated fetch.
  5. Pad where message length itself would reveal something.
  6. Track the crypto library in your SBOM and watch advisories.

Where Safeguard fits

Safeguard's SBOM and dependency scanning lists the push and crypto libraries in your build and checks them against known advisories. The free scan is at https://gold.safeguard.sh/scan.

Quick check

If I encrypt, can I put anything in the notification?

Content is protected in transit, but it still appears on the device screen. Keep sensitive detail out of notification text.

Does encryption hide that I sent a message?

No. The push service can see timing and length.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.