GHSA-HQ2V-CGW4-FW2W
Webhook delivery re-resolves the target hostname after validating it, allowing the SSRF guard to be bypassed by DNS rebinding
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-HQ2V-CGW4-FW2W divulgada | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
When the Grav API plugin delivers a webhook, it validates that the target hostname resolves to a public address and then hands the hostname to cURL, which performs its own separate lookup for the actual connection. The two lookups are independent, so someone who controls DNS for the hostname they configured can answer with a public address for the validation and a private one for the delivery, defeating the SSRF guard.
Affected versions
Grav API plugin (`getgrav/grav-plugin-api`) <= 1.0.15.
Details
`WebhookDispatcher::httpPost()` re-validates the target at dispatch time. That guard was added for GHSA-58q8, to catch a hostname that passed validation when the webhook was configured and changed before delivery:
$host = (string) parse_url($url, PHP_URL_HOST);
if ($host === '' || !self::hostIsPublic($host)) {
throw new \RuntimeException('Webhook URL targets a private or reserved address.');
}
$ch = curl_init($url);`hostIsPublic()` resolves the hostname itself and returns only a boolean; the addresses it validated are discarded. `curl_init()` then receives the URL with the hostname intact, so libcurl resolves it again when the request is made. Nothing links the address that was checked to the address that is connected to, and neither `CURLOPT_RESOLVE` nor `CURLOPT_CONNECT_TO` is set.
The redirect-based and scheme-based variants of this attack are already closed correctly by `CURLOPT_FOLLOWLOCATION => false` and the protocol restrictions in the same function. Only the rebinding variant remains open.
Impact
Someone able to configure a webhook can cause the site to issue a request to an address on its internal network, carrying the webhook's configured headers and body. Part of the response is retained in the delivery log, which gives a limited read-back channel.
Configuring a webhook requires the `api.webhooks.write` permission. We reviewed the codebase for lower-privileged paths that could set or influence a webhook URL and found none: the only writers are the webhook create and update endpoints, both behind that permission.
Exploitation is probabilistic rather than deterministic. It requires control of authoritative DNS for the hostname with a very low TTL, and winning a race between two lookups. Webhook delivery is repeatable, which gives an attacker repeated attempts.
Severity
Rated Low. Grav rates security issues by whether an actor can escape the trust scope of their role. Configuring a webhook is an administrative capability, and an account holding it can already direct outbound requests to arbitrary internet addresses and read back part of the response. This issue closes a gap in a defence-in-depth measure we added ourselves, rather than granting access that was not already delegated. Our security policy describes the full rating criteria.
Patches
Fixed in Grav API plugin 1.0.16. The hostname is now resolved once and the validated addresses are pinned onto the connection, so a delivery reaches exactly the address that was checked. The `Host` header, TLS SNI and certificate verification continue to use the hostname from the URL, so virtual hosting and HTTPS behave as before.
Credits
Reported by @alham-rizvi.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Packagistgetgrav/grav-plugin-api |
Sin parche | — | — | — |
Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/getgrav/grav/security/advisories/GHSA-hq2v-cgw4-fw2wLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
