GHSA-FQV4-9PM4-V2Q2
Unauthenticated password reset link poisoning in the API plugin through a URL that PHP and browsers parse differently
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-FQV4-9PM4-V2Q2 divulgada · CVSS 9.6 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
## Summary
An unauthenticated attacker can make the API plugin email a genuine password reset link that sends the victim's reset token to a host the attacker controls. The base URL check added for CVE-2026-61839 and CVE-2026-86196 validates the client-supplied `admin_base_url` (or `Origin` header) with PHP's `parse_url()`, then puts the original string into the link. A URL such as `https://attacker.example\@site.example` is read by PHP as host `site.example`, so it passes, but every browser treats the backslash as a path separator and opens `attacker.example`.
## Affected versions
getgrav/grav-plugin-api <= 1.1.20. This happens with or without `plugins.login.site_host` / `system.custom_base_url` set, because the attacker uses the site's real host as the part PHP checks.
## Details
`POST /api/v1/auth/forgot-password` passes `admin_base_url` to `ResolvesAdminBaseUrl::resolveAdminBaseUrl()`. `sanitizeHttpUrl()` and the origin check parse the candidate with `parse_url()`, which treats `attacker.example\` as user info, but the method returned the raw string, so the emailed link was `https://attacker.example\@site.example/reset?user=<user>&token=<token>`. Browsers follow the WHATWG URL standard and send the token to `attacker.example`. The `Origin` header branch had the same flaw. The Referer branch rebuilt the URL from its parsed parts and was not affected.
## Impact
An anonymous attacker who knows a user's email address, including a super-admin's, requests a reset with the crafted base URL. When the victim clicks the button in the genuine reset email, the token reaches the attacker, who sets a new password and takes over the account.
## Patches
Fixed in getgrav/grav-plugin-api 1.1.21. The base URL is now rebuilt from the scheme, host, port and path that passed the trusted-origin check, and a candidate that contains a backslash, user info, whitespace or control characters is refused.
## Credits
Reported by @Ne0X-Z.
Desglose de métricas
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-fqv4-9pm4-v2q2Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
