GHSA-35RJ-7VRX-29WQ
Open redirect in timeslider "Return to pad": unvalidated document.referrer allows redirect to attacker origin
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-35RJ-7VRX-29WQ divulgada | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
The `timeslider_returnToPad` toolbar command navigates the browser to `document.referrer` when a one-character string check passes. Because the check only inspects the character immediately before the last `/` in the referrer, any attacker-chosen origin whose path contains a segment ending in `p` (for example `https://evil.example/p/login`) is accepted, and the browser is redirected off-site.
Difference from CVE-2026-55087 (please read first)
This is not a duplicate of CVE-2026-55087 / GHSA-fjgc-3mj7-8rg8. That issue is the attacker-controlled `x-proxy-path` request header being concatenated into the server-side `/p/:pad/timeslider` redirect (a server-issued 302). This report is a different sink with a different input:
| | CVE-2026-55087 | This report |
|---|---|---|
| Sink | `src/node/hooks/express/specialpages.ts` (server) | `src/static/js/pad_editbar.ts:609` (client) |
| Input | `x-proxy-path` request header | `document.referrer` |
| Trigger | 302, no user interaction | one click on a toolbar button |
| Fixed in | 3.1.0 | not fixed (present in 3.3.10) |
They are related, though, and that is the point of this report: the mitigation shipped for CVE-2026-55087 was to stop serving the legacy direct timeslider URL and redirect back to the pad instead (PR #7710, commit `8c6104c5`). That mitigation is still bypassable by requesting `/p/<pad>/timeslider?embed=1`, and the page served that way still renders the "Return to pad" button, which is itself an open redirect. In other words, the previous fix moved the entry point from a server-side 302 to a client-side button without closing the redirect class.
Affected product
- Ecosystem: npm, package `ep_etherpad-lite`
- Vulnerable: `<= 3.3.10` (no fixed version available at time of report)
- The same code was confirmed present in release tags 1.8.18, 2.0.3, 2.2.7, 3.0.0, 3.1.0, 3.2.0 and 3.3.0, so the issue is long-standing rather than a recent regression.
Root cause
`src/static/js/pad_editbar.ts:605-614` (v3.3.10, HEAD `bc693d0`):
this.registerCommand('timeslider_returnToPad', (cmd) => {
if (document.referrer.length > 0 &&
document.referrer.substring(document.referrer.lastIndexOf('/') - 1,
document.referrer.lastIndexOf('/')) === 'p') {
document.location = document.referrer;
} else {
document.location = document.location.href
.substring(0, document.location.href.lastIndexOf('/'));
}
});The condition is intended to mean "the referrer is one of our own `/p/<pad>` URLs", but it is implemented as "the single character before the last `/` is `p`". It never parses the referrer and never compares the origin, so any external URL of the form `https://attacker/<anything>/p/<anything>` satisfies it. `document.location = document.referrer` then performs the navigation with no allow-list.
Evaluating the condition itself:
| referrer | char before last `/` | check |
|---|---|---|
| `https://evil.example/p/` | `p` | passes |
| `https://evil.example/p/login` | `p` | passes |
| `https://evil.example/p/deep/x` | `p` | passes |
| `https://evil.example/login` | `n` | rejected |
| `https://evil.example/p` (no trailing slash) | `/` | rejected |
Prerequisites (all verified — please do not assume a stronger claim than this)
- `?embed=1` is required on 3.3.10. Since 3.1.0, `/p/:pad/timeslider` without `?embed=1` returns a 302 back to the pad (`src/node/hooks/express/specialpages.ts:433-443`). With `?embed=1` the page is still served in full.
- The button must actually be visible. `iframe-mode` is only added when `window.parent !== window` (`src/static/js/timeslider.ts:95`), and `static/css/timeslider.css:9-19` only hides `#editbar` under `body.embedded-history-frame.iframe-mode`. So in the normal in-pad history mode the button is hidden, but for a direct top-level visit to `?embed=1` it is visible. The CSS comment documents this intent explicitly: direct visits keep their full chrome.
- The referrer must carry the full path. The browser default (`strict-origin-when-cross-origin`) trims a cross-origin referrer down to the origin, which fails the check. The attacker opts out in either of two ways, both verified:
- page-level `<meta name="referrer" content="unsafe-url">`
- per-link `<a href="..." referrerpolicy="unsafe-url">`
The second one is the more realistic one: the attacker only needs to place a single link on any page they control, not a whole page.
Reproduction
Environment: Etherpad 3.3.10 built from `bc693d0`, served on `http://127.0.0.1:9001`; attacker page served on `http://127.0.0.1:9999` (different origin); Chrome 155.0.8059.85 driven by Playwright. All clicks were real user clicks, not direct calls to the command handler.
- Attacker page at `http://127.0.0.1:9999/p/` contains `<meta name="referrer" content="unsafe-url">` and a link to `http://127.0.0.1:9001/p/payloadpad/timeslider?embed=1`.
- Victim clicks the link. The timeslider loads as a top-level page, with the "Return to pad" button visible in the top-right toolbar.
- Victim clicks "Return to pad". `document.location = document.referrer` fires and the browser navigates to `http://127.0.0.1:9999/p/`.
Observed results across five scenarios:
| # | Scenario | `document.referrer` | check | final URL after click | cross-origin |
|---|---|---|---|---|---|
| 1 | page-level `unsafe-url`, path `/p/` | `http://127.0.0.1:9999/p/` | passes | `http://127.0.0.1:9999/p/` | yes |
| 2 | default referrer policy (control) | `http://127.0.0.1:9999/` | rejected | `http://127.0.0.1:9001/p/payloadpad` | no |
| 3 | deep path `/p/deep/` | `http://127.0.0.1:9999/p/deep/` | passes | `http://127.0.0.1:9999/p/deep/` | yes |
| 4 | no referrer (direct visit) | `""` | rejected | `http://127.0.0.1:9001/p/payloadpad` | no |
| 5 | per-link `referrerpolicy` | `http://127.0.0.1:9999/plain/p/` | passes | `http://127.0.0.1:9999/plain/p/` | yes |
Scenarios 1, 3 and 5 are three independent successful redirects.
Impact
Phishing. A victim who follows an attacker link into the timeslider and then clicks the ordinary-looking "Return to pad" button is sent to an attacker-controlled origin, and the landing path is fully attacker-chosen (`/p/login` reads convincingly as an Etherpad login page). The expectation of "return to where I came from" is exactly what makes the button trustworthy.
This is not XSS: the referrer is generated by the browser and cannot be a `javascript:` or `data:` URL, so only `http(s)` destinations are reachable. Severity is therefore bounded by that.
Suggested fix
Parse the referrer instead of slicing it, and compare origins explicitly:
this.registerCommand('timeslider_returnToPad', (cmd) => {
const padUrl = document.location.href.substring(0, document.location.href.lastIndexOf('/'));
try {
const ref = new URL(document.referrer);
if (ref.origin === location.origin && /^\/p\//.test(ref.pathname)) {
document.location = ref.href;
return;
}
} catch { /* empty or unparsable referrer */ }
document.location = padUrl;
});A cleaner option would be to drop the referrer dependency entirely. History mode is now an in-pad iframe, so returning to the pad only needs to act on the parent window or leave history mode; the referrer check is a leftover from when the timeslider was a standalone page in 2011.
Limitations of this report
- Not tested against a real public deployment; origins were separated by port on localhost. The condition does not involve the host at all, so behaviour should be identical, but this was not exercised.
- Not tested with an HTTPS target and an HTTP attacker page.
- No claim is made about browser versions other than the one used.
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
npmep_etherpad-lite |
Sin parche | — | — | 1.8.14 afectada |
Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/ether/etherpad/security/advisories/GHSA-35rj-7vrx-29wqLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
