llamaCVEVulnerability Intelligence
/
Advisory · GitHub · npm · ep_etherpad-lite

GHSA-QQ7C-M9PC-7Q7V

.etherpad import lets any pad writer forge pad ownership, publicStatus and the deletion token

Sin parche publicado
Descargar PNG JSON
CVSS
—
medium
Fuente: —
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
ParcheSin parcheEl fabricante no ha publicado corrección
Exposición17 dDesde la divulgación, 2 nov 2026, 4:02 p. m.
Detección16 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada +1
Explotación
Remediación
Monitoreo
Detectada +1
2 nov 26
18 nov 26
20 nov 26
2 nov 26
7 nov 26
11 nov 26
16 nov 26
20 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-QQ7C-M9PC-7Q7V divulgada
Divulgación Modificada Última actualización del registro
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

# .etherpad import lets any pad writer forge pad ownership, publicStatus and the deletion token
Severity: Medium | CVSS 3.1 4.2 (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:L)

## Summary
`POST /p/:pad/import` with a `.etherpad` file calls `ImportEtherpad.setPadRaw()`, which writes every imported record whose key starts with `pad:<srcId>` to `pad:<targetId>` after swapping in the pad ID. Only the key prefix and the pad ID are checked. The sub-key and the value of the main `pad:<id>` record are not, so a user who can write to a pad with fewer than 10 revisions can set:

  1. `pad:<id>:deletionToken`, the record `PadDeletionManager` uses to check pad-deletion tokens. The attacker replaces the creator's recovery token with a hash of a token they choose.
  2. Fields of the `pad:<id>` record that `Pad.init()` copies onto the Pad with `Object.assign`, such as `publicStatus: true`. On a private group pad this turns off the session requirement in `SecurityManager.checkAccess`.
  3. `pad:<id>:revs:0` `meta.author`, which `handlePadDelete`, `isPadCreator` and the deletion-token issue code all use to decide who created the pad. The attacker becomes the "creator".

This is a sibling of the 2021 `.etherpad` import advisory (GHSA-w3g3-qf3g-2mqc). That fix limited imports to `pad`/plugin key prefixes but still trusts everything inside the `pad:` namespace, including security metadata that `.etherpad` exports never contain (`ExportEtherpad.getPadRaw` only emits `pad:<id>`, `:revs:N`, `:chat:N` and author records).

## Affected
ether/etherpad@398c5a6190996e6963b1bc1b458824c3412ac204
- src/node/utils/ImportEtherpad.ts:276-289: any `pad:<src>:<anything>` key is accepted and rewritten to `pad:<target>:<anything>`. The value is not checked.
- src/node/utils/ImportEtherpad.ts:318: `db.set(k, v)` writes every accepted record, overwriting existing ones.
- src/node/handler/ImportHandler.ts:211-221: the only gate is `pad.head < 10`.
- src/node/db/PadDeletionManager.ts:8,44-50: the token record key `pad:${padId}:deletionToken` sits inside the importable namespace, and `isValidDeletionToken` trusts any stored `hash`.
- src/node/db/Pad.ts:681: `Object.assign(this, value)` loads the imported `publicStatus` (and other fields).
- src/node/db/SecurityManager.ts:149: `publicStatus` decides whether a group pad needs an HTTP API session.
- src/node/handler/PadMessageHandler.ts:307-325, 350, 1344: creator status comes from `getRevisionAuthor(0)`, which the import controls.

## Details
`setPadRaw` builds `padKeyPrefixes = [...plugin prefixes, 'pad']` and, in `processRecord`, accepts a record when `padKeyPrefixes.includes(prefix)`. It then sets `keyParts[1] = padId` and stores the value in a temporary in-memory DB. After `pad.check()`, which only checks the revision/atext structure, all records are copied into the real DB with `db.set`. Nothing restricts the third key segment to `revs`/`chat`, and nothing strips security fields from the main pad record. Specifically:

  • A record `"pad:X:deletionToken": {"createdAt": 0, "hash": sha256hex(T)}` becomes the target pad's deletion token, and any token the creator saved stops working. `handlePadDelete` accepts it (`tokenOk`) whatever the caller's creator status or `allowPadDeletionByAllUsers`. The record outlives the 10-revision window, so the attacker can delete the pad weeks later after it has grown. A writer who is not the creator cannot normally do this.
  • `"pad:X": {..., "publicStatus": true}` makes a private group pad (`g.xxxx$name`) public. After that `checkAccess` grants access, including write access, to any client without an HTTP API session. Normally only the API key holder (`setPublicStatus`) can do this.
  • `"pad:X:revs:0": {"meta": {"author": "<attacker authorID>"}, ...}` makes the attacker the creator. They can then delete the pad without a token (`creatorOk`), change pad-wide settings (`padoptions`), and get a fresh deletion token.

Downstream layers checked: `Pad.check()` checks only head, pool, atext and savedRevisions consistency. `importexport.ts` checks only `checkAccess` + `userCanModify` (write access). `isValidColorId` cleans only `globalAuthor` colours. There is no allowlist of sub-keys or pad-record fields.

## Attacker & preconditions
- Write access to the target pad: any visitor of a public pad, or a group member with a valid session for a group pad.
- The target pad has fewer than 10 revisions when the import runs. Pads created through the API (`createGroupPad`/`createPad`) start at revision 0, and an attacker can wait for a newly created pad.
- `.etherpad` import is enabled by default, and the deletion-token part needs no soffice.

## Reproduction steps (local install, described, not executed)
1. Run Etherpad at the HEAD above with default settings and create an API key.
2. As the admin/API: `createGroup` → `createGroupPad(groupID, "p")`, leaving `publicStatus` false. Create author A (victim/owner) and author B (group member, attacker). Create sessions for both.
3. Confirm that without a `sessionID` cookie, `GET /p/g.xxx$p` returns access denied.
4. Write an `.etherpad` JSON file with source pad id `x` containing:
- `"pad:x"`: a valid pad record (copy one from any `.etherpad` export, with head 0) plus `"publicStatus": true`
- `"pad:x:revs:0"`: the matching rev-0 record with `meta.author` set to B's authorID
- `"pad:x:deletionToken"`: `{"createdAt": 0, "hash": "<sha256 hex of 'attackertoken'>"}`
5. As B, with B's `sessionID` cookie, `POST /p/g.xxx$p/import` the file (multipart field `file`, name `evil.etherpad`).
6. Observe:
a. `GET /p/g.xxx$p` without any session cookie now gets access, because the pad is public.
b. The DB key `pad:g.xxx$p:deletionToken` holds the attacker's hash. A `PAD_DELETE` socket message with `deletionToken: "attackertoken"` from any writing session deletes the pad, even after it has more than 10 revisions.
c. B is now treated as the pad creator (the pad-settings panel shows as editable and the delete button is available).

## Impact
A low-privileged pad writer can (a) turn a private group pad into a public pad that anyone with the URL can read and write without the session the integrator requires, (b) plant a lasting deletion capability and destroy the creator's recovery token, and (c) take over pad "ownership" (creator-only pad-wide settings and deletion). The time window is limited to young pads (fewer than 10 revisions), which is why attack complexity is High.

## CWE
CWE-915 (Improperly Controlled Modification of Dynamically-Determined Object Attributes); CWE-639 (Authorization Bypass Through User-Controlled Key)

## Suggested fix
In `setPadRaw`, accept only `pad:<id>`, `pad:<id>:revs:<n>` and `pad:<id>:chat:<n>` for the `pad` prefix, and explicitly reject `deletionToken` and any other sub-key. Build the main pad record from an allowlist (`atext`, `pool`, `head`, `chatHead`, `savedRevisions`, and maybe `padSettings` through `normalizePadSettings`), and keep or reset `publicStatus` from the existing target pad instead of the import. Consider keeping the existing rev-0 author (or making the importer the rev-0 author) so creator status cannot be forged.

AI assistance used. Please credit GitHub @barnessomer.

Versiones

Rangos afectados

Afectada Corregida Última
ep_etherpad-lite≤ 3.3.12
1.8.14
3.3.12
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
npmep_etherpad-lite
Sin parche — — 1.8.14 afectada
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/ether/etherpad/security/advisories/GHSA-qq7c-m9pc-7q7v

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.