GHSA-73H9-C5XP-GFG4
Etherpad does not regenerate the session ID on authentication, enabling SSO session fixation
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-73H9-C5XP-GFG4 divulgada · CVSS 7.5 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Etherpad does not regenerate the session ID on authentication → SSO session-fixation → account/admin takeover
Target: `ether/etherpad-lite` (TypeScript, Node.js), HEAD `0cd01fce` (v3.3.2), demonstrated with the official `ether/ep_openid_connect` SSO plugin v3.0.37.
Class: CWE-384 Session Fixation — the application never calls `req.session.regenerate()` when an anonymous express-session is upgraded to an authenticated (and possibly admin) one.
Impact: an unauthenticated attacker who can plant a cookie in a victim's browser (cookie-tossing from a sibling/sub-domain, MITM on a non-HTTPS hop, or any cookie-injection primitive) can take over the victim's account — including a full admin session — when the victim logs in via SSO. Runtime-proven end-to-end (admin takeover).
Channel: GitHub PVR on `ether/etherpad` (open). Finder credit. *(The concrete vulnerable flow also lives in `ether/ep_openid_connect`, whose PVR is disabled; the root fix belongs in core `webaccess` and protects every SSO/auth plugin, so this is filed against core.)*
Root cause (read at HEAD `0cd01fce`)
Etherpad's web/admin authentication is orchestrated by `src/node/hooks/express/webaccess.ts`. On a
successful authentication it writes the identity straight onto the existing express-session:
- HTTP-Basic path: `req.session.user = {...settings.users[ctx.username]}` (`webaccess.ts:202`).
- Plugin path: the `authenticate` hook (`webaccess.ts:174`, `await aCallFirst0('authenticate', ctx)`)
lets an SSO plugin set `req.session.user`.
`req.session.regenerate()` is never called — confirmed by grep across the whole tree (0 calls in
`src/node`), and 0 in the official `ep_openid_connect` plugin. So the session ID present *before*
authentication is reused *after* the privilege upgrade. That is the textbook CWE-384 condition, and per
OWASP ASVS the session ID must be rotated at any authentication/privilege-level change.
The HTTP-Basic path alone is not exploitable (an anonymous request gets `401` with no persisted cookie,
and a request carrying an already-authenticated cookie is served from that session and ignores new
credentials). The exploitable surface is any auth method that establishes a **pre-authentication
session** — exactly what every OIDC/OAuth RP does, and what the official SSO plugin does:
`ep_openid_connect/index.js` `/ep_openid_connect/login` (lines ~314-325), before redirecting an
unauthenticated user to the IdP, persists OAuth state in the session:
if (req.session.ep_openid_connect == null) req.session.ep_openid_connect = {};
req.session.ep_openid_connect.callbackChecks = {nonce, state, code_verifier}; // session saved -> Set-Cookie, NO user yetand the `authenticate` hook (lines ~344-358) later binds the user onto that same session:
req.session.user = users[userinfo.sub]; // no regenerate before/afterSo the session ID an attacker obtains from `/ep_openid_connect/login` survives the victim's login and
ends up owning the victim's authenticated (admin) session.
Runtime PoC (RUNTIME-PROVEN — full admin takeover)
Live Etherpad v3.3.2 + `ep_openid_connect@3.0.37` pointed at a minimal mock OIDC IdP (`idp.js`, issues
`sub=admin@idp`); `settings.users = {"admin@idp": {is_admin:true}}`. Driver: `oidc_fixation_poc.py`.
Transcript in `req-resp/poc-run.txt`:
STEP 1 attacker GET /ep_openid_connect/login -> 303; pre-auth express_sid C issued. sid(C)=CNf2SN2-lA4KfKbj9UcGKNrY_S181k_3
store user @ C (pre-auth): (session exists, no user) <-- persisted, USERLESS session; attacker knows C
STEP 2 victim (carrying planted C) -> IdP authorize -> /ep_openid_connect/callback (cookie C) -> 303 to /
STEP 3 GET / (cookie C) -> 200; sid still CNf2SN2-lA4KfKbj9UcGKNrY_S181k_3 (UNCHANGED across auth)
store user @ C: {'is_admin': True, 'displayname': 'Admin Victim', 'username': 'admin@idp'} <-- C is now ADMIN
STEP 4 attacker replays the SAME C captured in step 1 -> 200 (no-cookie baseline -> 303)
=> TAKEOVER CONFIRMED- STEP 1 — the attacker initiates SSO (no credentials) and captures the pre-auth, userless
- STEP 2 — the victim, carrying the planted `C`, completes SSO at the IdP as the admin and returns
- STEP 3 — the `authenticate` hook binds the admin identity onto the same session `C`.
- STEP 4 — the attacker replays the `C` they held since step 1 → an authenticated admin session
Severity
`CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H` = 7.5 (High).
- `PR:N` — the attacker needs no Etherpad credentials (the `/ep_openid_connect/login` entry point is unauthenticated).
- `AC:H` — exploitation requires a cookie-write primitive to plant `C` in the victim's browser (cookie-tossing from a related sub/sibling-domain, MITM on a non-HTTPS hop, or a cookie-injection bug).
- `UI:R` — the victim must perform an SSO login while carrying the planted cookie.
- `C:H/I:H/A:H` — demonstrated full admin account takeover; for a non-admin victim the impact scales down to that user's account/pads.
Honest scope. This is the standard session-fixation precondition set (plant-cookie + victim-login). The defect itself — no session-ID rotation on the auth boundary — is unconditional and confirmed in code; the PoC proves the consequence is a real admin takeover, not a theoretical weakness.
Suggested fix
In core `webaccess`, call `req.session.regenerate()` (preserving the just-established `user`) immediately
after a successful authentication — i.e. after the `authenticate` hook returns success and in the
HTTP-Basic path after setting `req.session.user`. This rotates the ID at the privilege boundary and
protects all SSO/auth plugins. (Equivalently/additionally, `ep_openid_connect` should regenerate the
session in its `/callback` handler after verifying the response, carrying the OIDC state across.)
Dup-gate
Distinct from all 8 published `etherpad` advisories: GHSA-vqfp is the author-token transfer endpoint
(a different credential and sink); GHSA-92hr is a token-RNG/timing/path hardening bundle (entropy, not ID
reuse); GHSA-qfmh is an OAuth JWT admin-claim check inside the API path. None mention
`session.regenerate` / session-fixation / express-session ID rotation. FRESH.
## Evidence
- `oidc_fixation_poc.py` — deterministic end-to-end takeover driver.
- `idp.js` — minimal mock OIDC IdP used to drive the victim's SSO login.
- `req-resp/poc-run.txt` — captured run: pre-auth userless cookie → unchanged sid across auth → admin session → attacker replay (200 vs 303).
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
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-73h9-c5xp-gfg4Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
