Are Web Push Subscription URLs Sensitive?

Learn why Web Push subscription URLs and keys need protection, and how to store, redact, test, and delete subscription data safely.

Published
Reading time
6 min read
Are Web Push Subscription URLs Sensitive?
On this page

A Web Push subscription endpoint is a URL your server uses to address a browser’s push subscription. It is not an ordinary public link: depending on the push service and subscription configuration, possession of the endpoint can help an unauthorized sender target that subscription.

This guide explains what to protect, what the associated keys do, and how to handle subscription data in application storage, logs, and testing.

Key Takeaways

  • Treat the endpoint as sensitive routing information, not as proof that someone can perform arbitrary actions on a user’s account.
  • Protect the complete subscription object. Its auth value is secret; p256dh is a public key, but still belongs with the subscription data.
  • Restrict access, avoid logging subscription values, and remove subscriptions when they are no longer needed.
  • Use disposable subscriptions for testing, and do not submit live endpoint data to third-party tools.

What a Web Push endpoint represents

When a browser creates a push subscription, the resulting object contains an endpoint: a URL identifying where a sender can address that subscription through a push service. It also provides key material needed to encrypt a push message payload for that subscription.

The endpoint is not necessarily a URL on your own application’s domain, nor is it a user’s account identifier. Your backend typically stores it alongside an internal association with the account or browser installation that registered it.

The endpoint should be treated as a capability-like address. Disclosure can make a subscription targetable, but the practical impact depends on the push service, sender restrictions, and whether the attacker also has the material needed for the message they want to send. An endpoint alone does not grant access to every account action or necessarily permit an attacker to send an encrypted notification.

The W3C Push API specification and RFC 8030 are the relevant standards for subscription and push-service behavior. They could not be consulted in this environment, so verify normative details and your push provider’s authentication requirements before relying on a particular deployment behavior.

Advertisement

What is in a subscription object?

The following is an illustrative, redacted representation of the object sent from a browser to an application server. The placeholders are not usable subscription values.

{
  "endpoint": "https://<push-service-host>/<redacted>",
  "expirationTime": null,
  "keys": {
    "p256dh": "<redacted-public-key>",
    "auth": "<redacted-auth-secret>"
  }
}
  • endpoint identifies the push-service destination for this subscription. Avoid exposing the full URL, including its path and any query parameters.
  • p256dh is the subscription’s public encryption key. It is not a private key, but copying it together with the other fields exposes more of the material used to send messages to the subscription.
  • auth is a secret used in push-message encryption. Handle it as a credential-like value.
  • expirationTime may be null; do not assume every subscription has a known expiration time.

These subscription keys are distinct from an application server’s VAPID signing keys. Where a subscription is restricted to an application server using VAPID, the sender also needs the appropriate private signing key. Keep that private key on the server, not in browser code or logs. Sender restrictions are useful defense in depth, not a reason to publish subscription objects.

Store and access subscriptions carefully

Send subscription data from the browser to your backend over HTTPS. Authenticate and authorize registration requests so one user cannot attach, inspect, or remove another user’s subscriptions. If registration relies on cookies, apply your application’s CSRF protections as appropriate.

On the backend:

  1. Store subscriptions only as long as needed to deliver notifications or meet a defined retention requirement.
  2. Limit database and backup access to services and staff that need it. Protect backups and encryption keys as well as the primary database.
  3. Encrypt sensitive stored data where appropriate for your threat model, including the auth secret and endpoint. Encryption at rest does not replace access control.
  4. Assign an internal, non-secret subscription ID for support and diagnostics. Do not use the endpoint itself as the ID shown in tickets or dashboards.
  5. Remove obsolete records after a user opts out, a subscription is replaced, or the push service indicates it is no longer valid. Check your provider’s documented response handling before automating deletion.

A user can have multiple subscriptions across browsers or devices. Design deletion so that removing one subscription does not inadvertently remove the others. For an opt-out, unsubscribe in the browser where possible and send an authenticated request to remove the matching server record; account deletion should also remove associated records and follow your backup-retention policy.

Redact logs and support tickets

Do not log the full subscription object, request body, endpoint, or auth value. This includes error reports, tracing attributes, analytics events, database query logs, and crash dumps—not just explicit application logs. A URL’s path or query string may contain the sensitive portion, so removing only query parameters is not enough.

For diagnostics, log a server-generated subscription ID and a coarse event such as registration failure or delivery failure. Review exception and HTTP-client logging settings: a failed request to a push service may otherwise record the full destination URL.

If a live subscription has already appeared in a public ticket or log, restrict access and remove the exposed data where possible. Treat it as potentially copied: replace or revoke the subscription as appropriate, remove the old server record, and review what other subscription data was exposed.

Advertisement

Test with disposable subscriptions

Use a dedicated test account and a separate browser profile or installation to create a subscription for development. Keep it out of production data and use only systems you are authorized to test. When testing is complete, unsubscribe that browser and delete its corresponding backend record.

For documentation, bug reports, and shared examples, replace the endpoint and both key values with obvious placeholders, as shown above. Do not paste a live endpoint into an online URL parser, decoder, ticket, chat, or other third-party tool. If you need to inspect its structure, use a trusted local environment and ensure the value is not retained in shell history or diagnostic logs.

Common Mistakes

  • Calling every field a private key. p256dh is public; auth is secret. Both should still be kept out of public subscription examples.
  • Assuming the endpoint is harmless because it is not a password. It can reveal a targetable subscription even though it does not authorize arbitrary account operations.
  • Assuming VAPID eliminates the need for secrecy. Sender restrictions can reduce abuse, but subscription data and signing keys still need protection.
  • Redacting only application logs. Proxies, monitoring systems, support exports, and backups can retain the same values.
  • Deleting only the browser subscription or only the database record. Coordinate both sides and handle failures or later cleanup.

Best Practices

Use least-privilege access, minimize retention, and build redaction into logging and support workflows before deploying push notifications. Review registration and deletion endpoints as authorization-sensitive operations, and test the lifecycle with disposable subscriptions rather than real users’ data.

Conclusion

Treat a Web Push subscription endpoint as sensitive routing information and the complete subscription object as data requiring protection. Careful storage, redaction, access control, and deletion reduce exposure without overstating what an endpoint alone can do.

What would your domain sell for?

A free TidyURLs account unlocks the Domain Estimator. It prices a name from 191,011 real domain sales.