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

GHSA-G9XM-3PQR-WCPH

Etherpad plugin-uninstall arbitrary directory deletion (GHSA-92hr-gmr6-h8cp incomplete fix)

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ón33 dDesde la divulgación, 18 oct 2026, 1:13 p. m.
Detección31 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
18 oct 26
18 nov 26
20 nov 26
18 oct 26
27 oct 26
4 nov 26
12 nov 26
20 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-G9XM-3PQR-WCPH 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
Summary

GHSA-92hr-gmr6-h8cp added isValidDependencyName() to validate plugin dependency names before they are used to build filesystem paths, but that check is only called from the install path (linkDependency/addSubDependency). The uninstall path (removeSubDependency → uninstallDependency) builds path.join(pluginInstallPath, dependency) from the same dependency-name data and calls rmSync(..., {recursive: true, force: true}) on it with zero validation, so an attacker-controlled dependency name can make Etherpad recursively delete an arbitrary directory outside pluginInstallPath when an admin uninstalls a plugin that declared it.

Details

Component
ether/etherpad, src/static/js/pluginfw/LinkInstaller.ts (plugin install/uninstall subsystem built on the live-plugin-manager npm package), reached via the admin-only Socket.IO plugin manager in src/node/hooks/express/adminplugins.ts.

Threat model
Attacker starts with: the ability to publish an npm package (any name) that an Etherpad admin might choose to install as a plugin — either as the plugin itself or, more subtly, as a transitive dependency declared in some plugin's package.json dependencies map. The attacker never needs any credentials on the target Etherpad instance.
Victim: the Etherpad instance admin (is_admin session, gated in adminplugins.ts:27), who installs the plugin through the normal "Install Plugin" admin UI and later uninstalls it (or an update replaces/removes it) through the same UI.
Attacker ends up with: recursive, forced deletion (rmSync({recursive:true, force:true})) of an arbitrary directory on the Etherpad host, at the privilege of the Etherpad server process — not merely inside the plugin sandbox directory (pluginInstallPath), but anywhere a crafted relative path can reach via path.join normalization.
Trust boundary crossed: this is the same boundary GHSA-92hr-gmr6-h8cp already named — "plugin dependency names from package.json were used to build filesystem paths without validation (admin-gated install)" — crossed via the sibling uninstall code path that the fix never touched.
Root cause
isValidDependencyName() is defined once and called from exactly two places, both on the install side:

// src/static/js/pluginfw/LinkInstaller.ts:183-187
private isValidDependencyName(dependency: string): boolean {
return typeof dependency === 'string' &&
!dependency.includes('..') &&
/^(@[a-z0-9-._~]+\/)?[a-z0-9-._~]+$/i.test(dependency);
}
// :189-190 (addSubDependency) and :216-217 (linkDependency) — both install-side
if (!this.isValidDependencyName(dependency)) {
console.error(`Skipping plugin dependency with invalid name: ${dependency}`)
return
}
The uninstall side never calls it:

// :76-91 — uninstallPlugin -> removeSubDependencies -> removeSubDependency (recursive, no name check)
public async uninstallPlugin(pluginName: string) {
const installedPlugin = this.livePluginManager.getInfo(pluginName)
if (installedPlugin) {
await this.removeSymlink(installedPlugin)
await this.livePluginManager.uninstall(pluginName)
await this.removeSubDependencies(installedPlugin)
}
}
private async removeSubDependencies(plugin: IPluginInfo) {
for (let dependency of Object.keys(plugin.dependencies)) {
await this.removeSubDependency(plugin.name, dependency)
}
}
private async removeSubDependency(_name: string, dependency: string) {
if (this.dependenciesMap.has(dependency)) return
try {
const json = JSON.parse(readFileSync(path.join(pluginInstallPath, dependency, 'package.json'), 'utf-8'))
if (json.dependencies) {
for (let [subDependency] of Object.entries(json.dependencies)) {
await this.removeSubDependency(dependency, subDependency) // recurses on more unvalidated names
}
}
} catch (e) {}
this.uninstallDependency(dependency) // :109 — no name check anywhere above this call
}

// :112-121 — the sink
private uninstallDependency(dependency: string) {
try {
accessSync(path.join(pluginInstallPath, dependency), constants.F_OK)
rmSync(path.join(pluginInstallPath, dependency), {
force: true,
recursive: true
})
} catch (err) { /* nothing to do */ }
}
dependency is the literal key from plugin.dependencies (i.e. the dependency's declared name in some installed plugin's package.json), the exact same kind of value GHSA-92hr-gmr6-h8cp was written to validate. path.join() normalizes .. segments, so a dependency name such as zzz/../../../../../../tmp/victim-dir resolves rmSync's target outside pluginInstallPath entirely.

The remaining question is whether live-plugin-manager's own dependency resolution can be made to accept such a name while still resolving successfully (the attacker needs the crafted name to survive as the key in the resulting IPluginInfo.dependencies, not be rejected outright). It can: live-plugin-manager's own name validation (isValidPluginName in that package) only rejects names starting with . or containing \; a name containing other path-traversal characters (forward slashes, ..) is not rejected by it. Separately, giving that dependency a non-semver version string that is instead a valid GitHub owner/repo spec (e.g. jashkenas/underscore) makes live-plugin-manager resolve the entry via its GitHub-install code path instead of failing the entry as an unresolvable npm version — so the crafted traversal string is preserved verbatim as the dependency's name in the resulting plugin metadata, while the version field is satisfied by a real, unrelated GitHub repository.

Already-known check
Read GHSA-92hr-gmr6-h8cp and the other 11 published ether/etherpad advisories in full. GHSA-92hr-gmr6-h8cp's own text says, verbatim: "Plugin dependency path handling (CWE-22): plugin dependency names from package.json were used to build filesystem paths without validation (admin-gated install). Now validated against the npm name grammar." — scoped explicitly to "install." None of the other advisories (including GHSA-w3g3-qf3g-2mqc, "Admin privilege escalation and arbitrary code execution via malicious *.etherpad imports") mention removeSubDependency, uninstallDependency, or the uninstall path. A GitHub code search across ether/etherpad issues/PRs for removeSubDependency, uninstallDependency, and rmSync found no existing issue or PR addressing this uninstall-side gap (the only PR touching LinkInstaller.ts's readFileSync calls, #7467, is an unrelated bug fix for plugin installation, not this validation gap). No existing advisory, issue, or PR that I found covers this.

Suggested fix
Call the existing isValidDependencyName() at the top of removeSubDependency() (and unlinkSubDependency's equivalent read, which has the same unvalidated-name shape on the symlink-removal side), mirroring how addSubDependency/linkDependency already guard the install side with the exact same helper.

AI Use Disclosure
AI (Claude) was used as a tool under my direction for code review, code summarization, and script development. I reviewed and verified the AI-generated results before submission.

Proof of concept

Versions tested
ether/etherpad, current master (HEAD bb0473c650b8253ba5bf14a59a7a6d7b0c16a24e, 15 commits past tag v3.3.8, package.json version still 3.3.8) — reproduced live.
Confirmed present in every tagged release from v2.0.0 onward (LinkInstaller.ts was introduced in commit fe106f0a, first included in tag v2.0.0); removeSubDependency/uninstallDependency have been unvalidated since that commit, including through the v3.3.8 release and the GHSA-92hr-gmr6-h8cp hardening pass, which touched only the install side.
Reproduction
Reproduced end-to-end against the real, unmodified live-plugin-manager npm package (the exact library LinkInstaller.ts wraps) and the real, unmodified LinkInstaller class — not a reimplementation:

Built a plugin directory whose package.json declares a dependency keyed by the traversal string, with a GitHub-spec version to satisfy live-plugin-manager's own resolver:
{ "dependencies": { "zzz/../../../../../../tmp/etherpad-poc/victim3": "jashkenas/underscore" } }
First confirmed the naive attempt is blocked: giving that same traversal string a normal semver version makes live-plugin-manager's own dependency resolution throw and abort registering the plugin entirely — this path is not exploitable that way.
With the GitHub-spec version instead, manager.installFromPath() (real live-plugin-manager call) succeeds, and manager.getInfo() returns an IPluginInfo whose dependencies key is the literal traversal string, unmodified.
Created a marker file inside a real directory outside the plugin sandbox (/tmp/etherpad-poc/victim3/marker.txt), confirmed it exists.
Ran the real LinkInstaller.uninstallPlugin() → removeSubDependencies → removeSubDependency → uninstallDependency chain against this IPluginInfo and the real on-disk plugin directory.
Observed: /tmp/etherpad-poc/victim3 (and the marker file inside it) was deleted — a directory entirely outside pluginInstallPath, via rmSync({recursive:true, force:true}).
Control (the originally-suspected naive path, ruled out): declaring the traversal string as a dependency name with an ordinary semver version (the "turn off the GitHub-spec trick" control) causes live-plugin-manager itself to reject the dependency resolution before any IPluginInfo is produced — so the attack requires the GitHub-spec-version technique specifically; a plain malformed dependency name alone is not sufficient. This isolates the actual bypass mechanism rather than just asserting the end deletion.

Stack / environment reach
Measured directly against the real live-plugin-manager package via installFromPath()/getInfo()/uninstall(), and the real LinkInstaller uninstall chain, with real marker files before/after. Did not perform a live npm publish of a malicious package to the public npm registry (out of scope/ethics — would pollute the real registry); instead confirmed with npm publish --dry-run (real npm CLI, v9.2.0) that the registry's own client-side package validation does not reject a dependencies map whose key is the crafted traversal string — only the package's own top-level name field is validated that strictly — so the same crafted package.json plausibly survives a real npm publish and would reach Etherpad's admin "Install Plugin" flow (socket.on('install', ...) in adminplugins.ts:140, which accepts any string and performs no catalog/allowlist check on install itself) unchanged. This specific leg (publishing to the live public registry and installing via the production npm-network code path rather than installFromPath) was not performed end-to-end.

Verification level
Isolated causation: real vendor code (live-plugin-manager + unmodified LinkInstaller) on both the install side (validated, confirmed to reject the naive form) and the uninstall side (unvalidated, confirmed to delete outside the sandbox), with a control that rules out the simpler/naive attack form and isolates the GitHub-spec-version bypass as the actual working mechanism. Not reproduced through the live npm registry or the Socket.IO admin UI itself end-to-end; the admin-UI reachability and registry-acceptance claims above are supported by reading the real adminplugins.ts route and a real npm publish --dry-run, not a live registry publish.

Impact

Any Etherpad admin who installs a plugin (or whose installed plugin pulls in a transitive dependency) containing a crafted dependency-name/version pair, and later uninstalls that plugin — including via a routine update/removal — triggers rmSync({recursive:true, force:true}) on an attacker-chosen path outside the plugin sandbox, at the Etherpad server process's filesystem privileges. This can destroy other application data (pad storage, settings, logs, other installed plugins, or any other path the process user can write to), a persistent, high-impact integrity/availability loss triggered through the ordinary plugin-management workflow rather than any debug/admin-only filesystem feature. This mirrors the precondition shape of the vendor's own GHSA-w3g3-qf3g-2mqc ("Admin privilege escalation and arbitrary code execution via malicious *.etherpad imports", CVSS 9.9) — an admin processing an attacker-supplied artifact through a normal admin workflow — though here the admin's action is the standard plugin install/uninstall flow rather than an explicit file import.

Suggested severity: High (CVSS 3.1 AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H = 8.1, computed independently). This models the actor pair as the npm-package-publishing attacker (no privileges on the target instance: PR:N) and the admin who chooses to install and later uninstall the plugin (UI:R) — a supply-chain shape, not an "attacker already has admin creds" shape. Happy to follow your standard process and your own severity judgement.

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

Versiones

Rangos afectados

Afectada Corregida Última
ep_etherpad-lite≥ 2.0.0 ≤ 3.3.8
1.8.14
2.0.0
3.3.8
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
npmep_etherpad-lite
Sin parche — — 1.8.14 no 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-g9xm-3pqr-wcph

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