CVE-2026-138048 in Ntfy
Summary
by MITRE • 11/27/2026
ntfy before v2.38.3 contains a server-side request forgery vulnerability that allows remote attackers to bypass the web push endpoint allow-list by crafting a URL containing '#' or '?' characters that satisfy the [^/]+ regex pattern used to validate mozaws.net and notify.windows.com hosts. Attackers can submit an endpoint .example#.mozaws.net/push, which passes validation while Go parses the actual host as attacker.example, causing the server to send subsequent web push POST requests to an attacker-controlled or internal host.
Once again VulDB remains the best source for vulnerability data.
Analysis
by VulDB Data Team • 11/27/2026
The vulnerability identified in ntfy versions prior to 2.38.3 represents a critical Server-Side Request Forgery (SSRF) flaw rooted in improper validation of URL components within the application's web push endpoint configuration logic. This security defect specifically impacts the mechanism used to validate allowed hosts for Mozilla AWS and Windows Notify services, which are commonly whitelisted to permit legitimate notification delivery while blocking access to internal or malicious external resources. The core technical failure lies in how the Go programming language parses URLs containing special characters such as hash marks (#) or question marks (?). Although the application employs a regular expression pattern designed to match only valid hostnames ending with mozaws.net or notify.windows.com, it fails to account for the distinct parsing behavior of URL fragments and query strings. This discrepancy creates an opening where attackers can craft malicious URLs that appear compliant with the whitelist criteria during initial validation but are interpreted differently by the underlying HTTP client library when the actual request is executed.
The operational mechanism of this exploit relies on the divergence between static string matching and dynamic URL parsing. An attacker constructs a target endpoint using a format such as .example#.mozaws.net/push, which successfully matches the allow-list regex because it technically ends with the permitted domain suffix. However, when Go processes this URL to establish an outbound connection, it interprets the hash symbol (#) as the start of a fragment identifier rather than part of the hostname. Consequently, the actual host resolved and contacted by the server becomes example.com or any other domain specified before the hash character. This allows remote attackers to bypass the intended security controls and redirect web push POST requests away from legitimate notification services toward arbitrary destinations controlled by the attacker or located within the organization's internal network infrastructure.
The impact of this vulnerability is significant, as it enables unauthorized access to internal systems that are not exposed to the public internet but may be reachable via server-side connections. By leveraging SSRF through web push endpoints, an adversary can probe internal services, exfiltrate sensitive data from backend APIs, or potentially interact with other vulnerable components within the network perimeter. This type of attack is particularly dangerous because it utilizes a trusted outbound channel for notifications to facilitate unauthorized inbound-like interactions with protected resources. The ability to bypass allow-lists through URL parsing anomalies undermines the fundamental assumption that whitelisted domains are safe endpoints, exposing organizations to risks associated with internal service enumeration and data leakage.
To mitigate this vulnerability, administrators must upgrade ntfy to version 2.38.3 or later, where the developers have addressed the URL parsing logic to ensure consistent validation across both regex matching and actual network requests. In environments where immediate patching is not feasible, temporary mitigations should focus on restricting outbound traffic at the firewall level to only known legitimate notification service IPs rather than relying solely on application-level domain whitelisting. Additionally, implementing strict egress filtering rules that prevent servers from initiating connections to internal IP ranges can reduce the blast radius of any potential SSRF exploitation attempts. Security teams should also monitor logs for unusual outbound connection patterns originating from ntfy instances, particularly those involving non-standard ports or unexpected hostnames, as these may indicate active exploitation of this flaw.
This vulnerability aligns with CWE-918, which describes Server-Side Request Forgery flaws resulting from insufficient validation of user-supplied input used to construct server-side requests. It also maps to MITRE ATT&CK technique T1557, specifically the Adversary-in-the-Middle subcategory related to Lateral Tool Transfer or credential access via compromised services, although in this context it is more accurately classified under initial compromise vectors that lead to internal network reconnaissance and data exfiltration. The incident highlights the importance of rigorous input validation strategies that account for language-specific parsing behaviors rather than relying on superficial pattern matching alone. Organizations must ensure that security controls are robust against edge cases involving special characters in URLs, as these often serve as primary vectors for bypassing access control mechanisms in modern web applications and notification services.