GHSA-7PJ6-F27J-WMCW
Post-authentication open redirect via login.php phpgw_forward (webserver_url substring guard bypass, default config)
Texto original en inglés · Ver en español
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-7PJ6-F27J-WMCW divulgada | |
| Divulgación | Modificada | Última actualización del registro | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
[MEDIUM] Post-authentication open redirect via `login.php?phpgw_forward=` (default config)
- CWE: CWE-601 URL Redirection to Untrusted Site (Open Redirect).
- CVSS v3.1: `AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N` = 6.1 Medium
- Affected component: `login.php::parseForward()` → `Api\Framework::redirect_link()` →
## Summary
`login.php` reads the attacker-supplied `phpgw_forward` parameter and, after successful login,
redirects the browser to it. `Session::link()` is supposed to keep redirects local by prefixing the
configured `webserver_url`, but its guard only prefixes when the target does not already contain
`"$webserver_url/"` as a substring:
// api/src/Session.php link()
if (($url[0] != '/' || $webserver_url != '/') &&
(!$webserver_url || strpos($url, $webserver_url.'/') === false)) { /* prefix webserver_url */ }With the default `webserver_url = /egroupware`, an absolute attacker URL that embeds that literal
substring — `https://evil.com/egroupware/` — makes `strpos(...) !== false`, so the guard is skipped
and the URL is used verbatim as the `Location`. Additionally, on `login.php` the top-of-`link()`
app-prefix (`$url = $app.'/'.$url`) is skipped because `currentapp == 'login'`, so the absolute URL is
not mangled.
Result: `Location: https://evil.com/egroupware/?cd=yes` — the victim is redirected off-site after a
legitimate login (or, on SSO installs where `Api\Auth::login()` returns a session with no credential
entry, on first navigation).
## Reachability
1. Attacker sends victim `…/login.php?phpgw_forward=https://evil.com/egroupware/`.
2. Victim authenticates (the login form action carries `phpgw_forward`, `api/src/Framework/Login.php`,
so it survives the POST; `parseForward` also reads it from POST).
3. `parseForward` → `forward = https://evil.com/egroupware/`, `extra_vars = cd=yes`.
4. `redirect_link` → `link()`:
- app-prefix skipped (`currentapp=login`). *(guard n/a)*
- webserver_url prefix skipped because the URL contains `/egroupware/`. *(guard bypassed)*
- `enforce_ssl`, if set, only rewrites `http:`→`https:` (still `evil.com`). *(no host allowlist)*
5. `Header("Location: https://evil.com/egroupware/?cd=yes")`.
Alternate vector: on deployments with `webserver_url` of `/` or empty (reverse-proxy/docker roots),
`phpgw_forward=//evil.com/` is protocol-relative and passes the same guard.
## Impact
Credential-phishing and OAuth/redirect-chain abuse: a link to the legitimate EGroupware host lands
the user on an attacker page after login, defeating the trust signal of the real login domain. On SSO
installs the redirect can fire with no credential entry.
## Preconditions
- Default `webserver_url` (`/egroupware`) — no config change required. Victim clicks the link and
completes login (`UI:R`).
## Evidence
- `login.php::parseForward()` and the `Api\Auth::login()` SSO branch calling `redirect_link($forward)`.
- `api/src/Session.php::link()` substring guard (`strpos($url,$webserver_url.'/')===false`) and the
`currentapp=='login'` app-prefix skip.
- `api/src/Framework.php:212-249` — `redirect()` emits `Header("Location: $url")` with no host validation.
## Adversarial re-read
- *Does the app-prefix (`$app.'/'.$url`) break the absolute URL?* No — it is skipped for
`currentapp ∈ {login,logout}`, which is the case on `login.php`. (Verified in `link()`.)
- *Does `enforce_ssl` sanitize the host?* No — it only swaps the scheme to https, preserving `evil.com`.
- *Is the value reflected into HTML (XSS)?* Not via this sink — it is a `Location:` header; browsers
do not execute it. Pure open redirect. (A `javascript:`/`data:` scheme in `Location` is ignored by
modern browsers, so this is redirect-only.)
- Result: no concrete blocker for the open-redirect claim. CONFIRMED (Medium).
## Remediation
In `Session::link()` / the login forward handling, reject any `phpgw_forward` that is an absolute URL
or protocol-relative (`//`), or validate its host against an allowlist (the configured
`webserver_url` host only). Do not use `strpos(webserver_url.'/')` as a locality test — an attacker
controls the rest of the URL. Canonicalize to a path-only forward.
## Confidence
High (Medium severity) — guard bypass verified against `link()` source and the default
`webserver_url`.
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Packagistegroupware/egroupware |
Corregida | 23.1.20260710, 26.7.20260710 | — | — |
23.1.2026071026.7.20260710Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/EGroupware/egroupware/security/advisories/GHSA-7pj6-f27j-wmcwLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
