CVE-2026-114516: Etherpad: Pre-auth arbitrary file read
Critical CVSS 9.8
- OSV id
- GHSA-mc8w-wjhw-45x5
- Also known as
- CVE-2026-114516
- Published
- Last modified
Affected packages
| Package | Affected versions | Fixed in |
|---|---|---|
| ep_etherpad-lite npm |
>= 1.8.14, < 3.3.3 | 3.3.3 |
How to fix it
Upgrade ep_etherpad-lite to 3.3.3 or later.
npm install ep_etherpad-lite@3.3.3
# if it is an indirect dependency: npm update ep_etherpad-lite (or npm audit fix)
- If it is an indirect dependency, upgrade the package that depends on it, or force the version with "overrides" (npm), "resolutions" (Yarn) or "pnpm.overrides" (pnpm) in package.json.
- Check the changelog for breaking changes (especially across major versions), update the lockfile with the package manager, and run your tests.
Not sure whether your project uses an affected version? Check your lockfile below for free.
Details
Summary
An unauthenticated path‑traversal / arbitrary file read vulnerability in Etherpad's /static/* handler allows any remote, unauthenticated user to read any file on the server's filesystem (e.g. GET /static/plugins/ep_etherpad-lite/static/..%5C..%5C..%5C..%5C..%5C..%5C..%5Cetc/passwd returns /etc/passwd) available to the user running the etherpad software. Because the endpoint is mounted before the authentication middleware, no credentials, session, or configuration change are required. The read primitive could escalate to a full server compromise: on a typical deployment by disclosing settings.json / credentials.json / /proc/self/environ, which contain the admin password, giving an attacker an admin session and, through the admin plugin installer, remote code execution.
Details
Etherpad serves plugin static assets through src/node/utils/Minify.ts. The request path is first passed through the canonical sanitizer src/node/utils/sanitizePathname.ts, which is careful to convert backslashes to forward slashes only on Windows:
// src/node/utils/sanitizePathname.ts:11-20
p = pathApi.normalize(p);
if (pathApi.isAbsolute(p)) throw new Error(`absolute paths are forbidden: ${p}`);
if (p.split(pathApi.sep)[0] === '..') throw new Error(`directory traversal: ${p}`);
// THIS CONVERSION MUST ONLY BE DONE ON WINDOWS, otherwise on POSIXish systems '..\\' in the input
// pathname would not be normalized away before being converted to '../'.
if (pathApi.sep === '\\') p = p.replace(/\\/g, '/');
On Linux a backslash is an ordinary filename byte, so an input segment like ......\test contains no ./.. path components and passes every check in sanitizePathname unchanged. The project's own test suite confirms this: src/tests/backend-new/specs/sanitizePathname.ts:62 lists ['posix', '..\foo'] among the accepted paths (returned unchanged).
The vulnerability is that Minify.ts then performs that Windows‑only conversion unconditionally, after the sanitizer has run, justified by a comment asserting the opposite of the invariant above:
// src/node/utils/Minify.ts:171-186
const match = filename.match(/^plugins\/([^/]+)(\/(?:(static\/.*)|.*))?$/);
if (match) {
const library = match[1];
const libraryPath = match[2] || '';
if (plugins.plugins[library] && match[3]) {
const plugin = plugins.plugins[library];
const pluginPath = plugin.package.realPath; // for 'ep_etherpad-lite' == <root>/src
filename = path.join(pluginPath, libraryPath); // -> absolute path, backslashes preserved
// ... "This conversion does not introduce a directory
// traversal vulnerability because all '..\\' substrings have already been removed by
// sanitizePathname." // <-- FALSE on POSIX
filename = filename.replace(/\\/g, '/'); // <-- reintroduces ../ AFTER the check
}
After line 186 the string becomes a real traversal (<root>/src/static/../../../../etc/passwd) with no re‑normalization and no containment check before the filesystem calls at Minify.ts:248 (fs.stat) and Minify.ts:315 (fs.readFile). Because path.join at line 179 produced an absolute path, path.resolve(ROOTDIR, filename) discards ROOTDIR entirely, and POSIX path.resolve collapses surplus .. at /, so the payload is root‑depth‑agnostic.
The route is reachable pre‑authentication. It is registered on the expressPreSession hook:
// src/ep.json
{ "name": "static", "hooks": { "expressPreSession": "ep_etherpad-lite/node/hooks/express/static" } }
// src/node/hooks/express/static.ts:38
app.all('/static/*filename', minify);
and expressPreSession runs before the auth middleware:
// src/node/hooks/express.ts:244-247
await hooks.aCallAll('expressPreSession', {app, settings}); // static route registered here
app.use(exports.sessionMiddleware);
app.use(webaccess.checkAccess); // auth runs AFTER
The plugin branch is always taken because src/static/js/pluginfw/plugins.ts:153-158 unconditionally registers the core pseudo‑plugin ep_etherpad-lite with package.realPath = <root>/src.
Two decode facts make the exploit functional: Express 5 / path‑to‑regexp v8 decode wildcard params per segment, once ((v) => v.split('/').map(decodeURIComponent)), so req.params.filename.join('/') (Minify.ts:147) yields the once‑decoded path fed to the sanitizer, and %5C (encoded backslash) is the only working separator (%2F decodes to /, is re‑split, and is rejected by the split('/')[0] === '..' guard).
PoC
Applies to a default production deployment (no special configuration; works on Linux, e.g. the Docker image or a systemd source install). Replace TARGET:9001 with the instance.
- Read /etc/passwd (or any file) with no authentication. --path-as-is prevents the client from folding the traversal:
curl --path-as-is \
'http://TARGET:9001/static/plugins/ep_etherpad-lite/static/..%5C..%5C..%5C..%5C..%5C..%5C..%5Cetc/passwd'
Other high‑value reads (over‑shoot the .. depth; it is absorbed at /):
admi
References
Am I affected?
Upload or paste your lockfile. We check every package version in it against OSV.dev, this advisory included, and email you the vulnerable ones with the version that fixes them. Free, and no account needed.
About this data
Source: GitHub Advisory Database via OSV.dev (CC-BY 4.0). Severity comes from the advisory's own rating when it has one, else from its CVSS score.