psf-etherpad-static-traversal-check(8)

Script: /opt/psf-security-patches/etherpad/etherpad-static-traversal-check.sh. Tool page: Etherpad static path traversal. Source. With the package installed: man psf-etherpad-static-traversal-check.

Etherpad static path-traversal check for CVE-2026-114516  (v1)

If this software is helpful, consider a donation to our 501c3 nonprofit:
https://privacysafe.foundation

GHSA-mc8w-wjhw-45x5 / CVE-2026-114516: Etherpad Lite (npm package
"etherpad-lite"), critical, CVSS 3.1 9.8
(CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H), CWE-22/CWE-200/CWE-306.
Reported by gcm-explo1t, published 27 October 2026. Affects 1.8.14 through
3.3.2; fixed in 3.3.3.

Etherpad's src/node/utils/sanitizePathname.ts rejects a request path
containing a literal '..' path component, and converts a literal backslash
to a forward slash only on Windows, by design, since on POSIX a backslash
is an ordinary filename byte and folding it early would make a real '..\\'
filename impossible to reach. src/node/utils/Minify.ts, which serves a
plugin's static assets, runs that sanitizer first and then, for the
request's plugin-static branch only, folds every backslash to a forward
slash again unconditionally, on every platform, justified by a comment
asserting the opposite of the invariant above. On a GNU/Linux host this
turns an inert '..\\' sequence the sanitizer passed as ordinary bytes into
a live '../' sequence after the one check that would have caught it, and
because the plugin path is joined as an absolute path first, the eventual
path.resolve() call discards the intended root entirely, so the traversal
reaches any file the Etherpad process can read regardless of how deep the
install is nested.

The route (src/node/hooks/express/static.ts, 'app.all("/static/*filename",
minify)') is registered on Etherpad's expressPreSession hook, which the
Express app runs before it installs the session and auth-check middleware
(src/node/hooks/express.ts). It is therefore reachable by anyone who can
send an HTTP request to the port, with no account, no session and no
config flag (requireAuthentication, requireAuthorization, users) able to
gate it. A request only needs the literal plugin-path prefix and a
URL-encoded backslash, '%5C', since an encoded forward slash ('%2F') is
decoded and re-split by Etherpad's router before reaching the sanitizer
and is rejected there; a plain reverse proxy does not block this, because
'%5C' is ordinary request-path text that proxies forward unchanged. The
always-registered core pseudo-plugin name is 'ep_etherpad-lite', which
means every installation has at least one working plugin-path prefix
regardless of which third-party plugins are actually installed.

What a successful read can reach: settings.json and credentials.json
(admin password, session secret, database credentials, SSO client
secrets), /proc/self/environ (any secret passed as an environment
variable, such as an admin password set for a container deployment), TLS
private keys, the pad database file, and ordinary OS files. The disclosed
admin password then mints an admin session against POST /admin-auth/,
and an admin session can install an attacker-controlled plugin through
the /pluginfw/installer Socket.IO namespace, which Etherpad requires
in-process, i.e. remote code execution as the Etherpad process user.

What this script does:
  check     - read-only. Finds installed etherpad-lite copies (by
              package.json under the usual install roots, or a running
              process's working directory) and reports each one's version
              against the fixed release. Exits 1 if any installed copy is
              below 3.3.3, 0 if every one found is at or above it, 2 if
              none was found or the result could not be determined.
  hunt      - read-only. Greps readable web server and Etherpad logs for
              the request-path signature this exploit requires: the
              plugin-static route together with a URL-encoded backslash.
              A match is a strong, specific indicator, since that
              sequence has no legitimate reason to appear in ordinary
              traffic; finding none does not prove nothing happened, since
              a successful read need not be logged anywhere this script
              can reach, and a request that only reads one known-harmless
              file would still match.
  mitigate [--dry-run] [--reload] - nginx only (see the README for Apache). Adds an
              nginx snippet that rejects any request whose raw URI
              contains an encoded backslash ('%5c'/'%5C') with a 400,
              included from the http block so it applies to every server
              Etherpad might be proxied behind on this host, backs up
              every file it touches, verifies the result with 'nginx -t',
              and rolls back automatically if the test fails. This blocks
              the one separator this exploit depends on; it is not a
              substitute for upgrading, since any other route this script
              does not know about that relies on the same decode quirk
              would not be covered. Requires root. --reload gracefully
              reloads nginx afterward (systemctl reload where that unit
              exists, otherwise nginx -s reload); without it, reload
              nginx yourself once you're satisfied.
  rollback [--dry-run] [--reload] - restores every file mitigate backed up and
              removes the snippet, then verifies with 'nginx -t'.
              Requires root. --reload as above.
  rules     - prints a short explanation with no side effects.
  version   - prints this script's version.

What this script can't see: a backslash-handling bug reachable through a
path other than the plugin-static branch described above (none is known
as of this script's writing); an Apache or other reverse proxy in front of
Etherpad, which needs the equivalent rule added by hand (see the README);
and an install this script's search roots do not cover, such as one built
from source in an arbitrary directory with no readable package.json.

--dry-run (mitigate, rollback): prints what would change and writes
nothing, so it needs no root.
Exit codes: check: 0 clear, 1 exposed, 2 undetermined/error.
            hunt: 0 nothing found, 1 found a match, 2 error.
            mitigate/rollback: 0 success, 2 error.
PSF_LOCK_WAIT: seconds a run that changes the host waits for another one
that is already changing it (default 30), then exit 2.

The Security Patches software and this documentation are dedicated to the public domain under CC0 1.0 Universal. Other pages on privacysafe.app/docs are CC BY-SA 4.0 unless the page says otherwise.

The PrivacySafe Ecosystem

Shop at Ivy Cyber

Ivy Cyber offers PrivacySafe products and services in the USA and has partnerships with 3NSoft in Canada and Kuip Limited in the European Union. Enterprise services and consulting are available at ivycyber.com

PrivacySafe Foundation is a 501(c)(3) nonprofit public charity that supports the development of the PrivacySafe applications, along with the components they rely upon: 3NWeb protocols, filesystem, documentation, and reference implementations.

PrivacySafe Foundation

Donations to PrivacySafe Foundation support education, research, documentation, and public code. Purchases from Ivy Cyber support PrivacySafe products, services, hosting, and technical support. Together, we're building a better web.