Web Push Notifications and Permissions
What you'll learn: How web push notifications create security risks through permission abuse, phishing, and social engineering attacks.
Web push notifications let websites send messages to users even when they're not actively browsing. While useful, they introduce a significant attack surface centered on permission abuse and user trust exploitation.
The Security Problem
When a site requests push notification permission, users often click "Allow" without thinking—especially if prompted repeatedly or manipulated through dark patterns. Once granted, this permission can be abused to:
- Spam users with unwanted content
- Phish credentials via fake urgent alerts ("Your bank account was compromised—click here!")
- Deliver malware links disguised as legitimate notifications
- Social engineer actions through fake security warnings or prize announcements
Unlike email spam, push notifications appear system-native, making them seem more trustworthy. They bypass browser tabs and appear directly on the device, catching users off-guard.
Common Attack Patterns
Permission hijacking: Malicious sites trick users into granting notification permissions through misleading prompts ("Click Allow to prove you're human" or "Allow notifications to continue reading").
Notification phishing: Once permission is granted, attackers send deceptive messages impersonating banks, tech support, or security alerts with malicious links.
Cross-site permission abuse: Compromised legitimate sites can abuse existing trusted permissions to deliver malicious notifications.
Best Practices
- Only request notification permission when clearly needed for core functionality
- Never auto-prompt on page load
- Make permission requests contextual and explain the value
- Implement server-side validation of notification content
- Allow users to easily revoke permissions
- Rate-limit notification frequency
- Never include sensitive data in notification content
- Use HTTPS (required for push API)
Key Takeaway: Web push notifications are powerful but easily abused; limit permission requests to legitimate use cases, educate users, and never trust notification permissions as a security control.