Summary
Grav's webhook dispatch feature allows authenticated users with specific permissions to configure webhooks using unsupported cURL protocols such as file://, dict://, and gopher://.
When these webhooks are triggered, an attacker can cause the server to initiate unintended outbound or local requests, potentially exposing local files, process information, or internal services.
Affected context
This vulnerability occurs in Grav installations that expose the webhook management functionality to users with api.webhooks.write permission.
In such setups, the application uses cURL to dispatch webhooks without limiting allowed protocols, meaning file://, dict://, and gopher:// URLs can be registered and later triggered.
Deployments where the Grav process has access to sensitive local files or reachable internal network services are more likely to experience impactful exploitation, especially when webhooks are actively used for automation or integrations.
Exploit preconditions
- Attack surface: Webhook creation and dispatch endpoints in Grav's API or admin interface.
- Required access: Authenticated access with
api.webhooks.writepermission to configure or modify webhook URLs. - Trigger point: Any event or action that causes the application to execute the configured webhook via cURL.
- Why exploitation is possible: The webhook dispatch implementation does not restrict or validate cURL protocol schemes, allowing attackers to abuse protocol handlers like file://, dict://, and gopher:// to redirect requests towards local resources or internal services.
Why this happens
The core issue is a missing validation step around outbound request destinations in the webhook subsystem.
By allowing arbitrary URLs to be passed directly to cURL without restricting protocol schemes or enforcing a safe allowlist, the application effectively lets users control where the server initiates requests.
This maps to CWE-918: Server-Side Request Forgery (SSRF), where user-provided input is used to construct server-side network or resource requests that can target internal or otherwise inaccessible endpoints.
Potential impact
- Unauthorized reading of local files accessible to the Grav process via file:// URLs.
- Exposure of process or environment information by querying local or special endpoints.
- Access to internal services or metadata APIs through SSRF, potentially aiding further compromise.
- Pivoting into protected network zones reachable only from the application server.
- Collection of sensitive configuration, credentials, or tokens stored on the server or exposed by internal APIs.
General mitigation guidance
Effective mitigation focuses on tightening control around outbound webhook destinations and protocol usage.
Common defensive patterns include:
- Enforcing an explicit allowlist of safe protocols (e.g., https:// and http://) for webhook URLs.
- Validating hostnames and IP addresses to prevent access to localhost, loopback, link-local, or private network ranges.
- Centralizing outbound HTTP client configuration to ensure protocol and destination checks are consistently applied.
- Running the application under least-privilege accounts with limited filesystem and network access to minimize the impact of misdirected requests.
- Designing webhook features with secure defaults, such as rejecting non-HTTP(S) schemes and logging attempts to register unsafe URLs for operational visibility.
How teams detect issues like this
Detection typically combines code-level and operational monitoring practices:
- Static analysis or code review focused on outbound request construction, flagging user-controlled URL inputs passed directly to HTTP clients or cURL without scheme or host validation.
- Security guidelines that require all webhook or integration endpoints to apply protocol allowlists and internal network restrictions.
- Runtime logging of webhook registrations and dispatches, including protocol and destination information, to spot unusual schemes like file://, dict://, or gopher://.
- Periodic configuration audits to identify webhooks pointing to non-standard or internal endpoints.
- Use of automated application security testing tools that simulate SSRF patterns against webhook or integration functionality.

