DEV Community

johnettwawers
johnettwawers

Posted on

ntfy's Web Push Allow-List Missed the Host That Go Parsed

ntfy's Web Push Allow-List Missed the Host That Go Parsed

A web push endpoint is a URL that a notification server later uses for a POST request. When that URL is supplied by a user, validation must answer a concrete question: will the HTTP client connect to the host that the policy approved? CVE-2026-138048 found a case where ntfy's allow-list validation and Go's URL parser answered that question differently.

The parser mismatch

The vulnerable validation tried to restrict endpoints to mozaws.net and notify.windows.com. Its regular expression accepted a crafted URL such as endpoint.example#.mozaws.net/push, according to the CVE record. The fragment satisfied the validation pattern, but Go parsed the actual URL host as endpoint.example. The server could then send a later web push POST to that different host.

This is an interpretation conflict. The same string passes one component's view of the destination and reaches a different destination in another component. URL fragments and query delimiters are ordinary parts of URLs, so a policy must parse the URL with the same library and normalization rules used by the outbound client.

Impact and limits

The CVE describes a server-side request forgery issue affecting ntfy before 2.38.3. CVSS 4.0 assigns a base score of 6.9 and CVSS 3.1 assigns 5.3. The confidentiality impact in the published vectors is none, while integrity impact is low. That differs from the common assumption that every SSRF immediately returns internal data. A push request may be blind, and the effect depends on what service receives it and how the push payload is handled.

A blind request can still reach a loopback service, a control endpoint, or an internal API. The absence of a response in the notification workflow does not make the destination safe.

Building a destination policy

An allow-list should be enforced on parsed host data, not on a substring or a pattern that can span a fragment. The validation path should reject user information, unexpected ports, non-HTTPS schemes where HTTPS is required, and any normalization difference. It should also revalidate the host at request time.

Production push workers should not have broad network reach. Restrict egress to the approved push providers, resolve names to public addresses, and block link-local, loopback, private, and metadata ranges. Log the original endpoint, parsed host, resolved addresses, and the request result while keeping subscription secrets out of application logs.

Upgrade and review

Upgrade to ntfy 2.38.3 or later. Then review stored push subscriptions for URLs that contain fragments or unusual authority components. A subscription URL should be a normalized HTTPS endpoint with the provider host in the authority component. If the client follows redirects, apply the same host and address policy to every redirect.

Teams that expose a public notification service should also test whether an unauthorized endpoint can cause outbound requests to a controlled listener. The test should show which component parses the host and which component makes the connection. That evidence is more useful than a general claim that the service has an allow-list.

The CVE does not say that every stored subscription was malicious or that all deployments had reachable internal services. The upgrade closes the parser mismatch; the network policy limits what a future mismatch can reach.

References

Top comments (0)