GHSA-5FPX-Q3R6-QX4H
Anonymous attackers can poison password-reset links through the CloudFront protocol header
Texto original en inglés · Ver en español
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-5FPX-Q3R6-QX4H divulgada | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
An anonymous visitor can make a Grav site send a genuine password reset email whose link points at a host the attacker controls, by adding a forged `CloudFront-Forwarded-Proto` request header to a forgot-password request. If the account owner clicks the link, the attacker receives the username and a live reset token and can set a new password. When the account is a super admin, that is full control of the site. This works on a default configuration once the Email plugin can send mail.
Affected versions
Grav 2.x from 2.0.0 up to and including 2.2.17, and Grav 1.7 up to and including 1.7.53.6. The ungated header read was added in Grav 1.5.7. The sites that are exposed are those where neither `system.custom_base_url` nor `plugins.login.site_host` is set, which is the default.
Details
`Uri::createFromEnvironment()` copies the `CloudFront-Forwarded-Proto` header into the URL scheme without checking the `system.http_x_forwarded.protocol` opt-in and without checking that the value is `http` or `https`. A value such as `https://evil.example/` therefore makes the site's base URL, absolute root URL and every absolute URL built from them begin with `https://evil.example/://<site>` for that request. The Login plugin's `/forgot_password` and the API plugin's `/api/v1/auth/forgot-password` build the link in the mail from these values. The change that made the other forwarded headers opt-in (first released in 2.0.0-rc.3) left this branch ungated, and a raw `X-FORWARDED-PROTO` environment branch lacks the same gate.
The attacker only needs to know the email address of the account to target. They send one anonymous forgot-password request for it with the forged header. The site then mails the real owner a reset message from the site's own sender, with the site's own template, whose button points at the attacker's host. A control request that puts the same value in `X-Forwarded-Proto` stays on the site's own host. This is the same outcome the plugins already guard against for a forged `Host` header (GHSA-262p-56vv-7v5r). What this header adds is reach into sites whose web server or CDN answers only for the site's own name, so a forged `Host` no longer works, but that have no base URL configured.
Impact
Exploitation needs a victim to click a link in an unexpected but genuine looking reset email, working outgoing mail, and no configured base URL. The attacker is anonymous, but this is rated High rather than Critical because it needs the victim's click, and because setting `system.custom_base_url`, setting `plugins.login.site_host` or enforcing trusted hosts defeats it. The reset token is valid for 24 hours, so a delayed click is enough.
Patches
Fixed in Grav 2.2.18 and 1.7.53.7. `CloudFront-Forwarded-Proto` is now read only when `system.http_x_forwarded.protocol` is enabled, in both places it was used, and the scheme must be exactly `http` or `https`. The raw `X-FORWARDED-PROTO` branch and the request object used by the PSR-7 layer follow the same policy. Operators who sit behind CloudFront and rely on this header need that option on. It is off by default in Grav 2.x. In Grav 1.7 it is on by default, so the change that matters there is the value check, which stops a forged value from reaching the URLs Grav builds.
Workarounds
Set `system.custom_base_url` or `plugins.login.site_host` to the site's real address, or strip the `CloudFront-Forwarded-Proto` header at the web server or proxy when CloudFront is not in front of the site. Either one makes the reset link use the configured host.
Credits
Discovered by Anthropic's OSS Scanner (ANT-2026-K8SA0DQN).
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 |
Corregida | 1.7.53.7, 2.2.18 | — | — |
1.7.53.72.2.18Arsenal 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-5fpx-q3r6-qx4hLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
