Independent PoC and reproducible lab for CVE-2026-97332 — User Private Files < 2.2.0 unauthenticated private file disclosure on WordPress Multisite.
[!NOTE] This repository is an independent reproduction and Proof of Concept for CVE-2026-97332.
Original vulnerability discovery: Akshat Parikh (SN1PER). CNA / advisory: WPScan. Independent PoC and reproduction: Kolya080808.
Unauthenticated disclosure of other users' private files in the WordPress
plugin User Private Files (wp.org slug user-private-files) before 2.2.0
on multisite installations. The plugin stores every user's private documents
inside the plain uploads tree and protects them with a single RewriteRule
appended to the root .htaccess, which routes file requests through a PHP
access check. On a multisite network that rule is never reached: one plain
GET — no cookies, no headers, no login — returns another user's private file
as static content. Broken Access Control, CWE-284, CVSS 3.1 5.3
(AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N).
This repository contains a working, dependency-free Python exploit and a two-container docker lab (vulnerable 2.1.9 and patched 2.2.0, both WordPress multisite) to reproduce the attack end-to-end.
[!CAUTION] This material is provided for authorized security research and defensive testing only (see the disclaimer at the bottom). Attacking systems you do not own or operate without written permission is illegal.
The plugin keeps private files as ordinary attachments in a flat, per-site
uploads subdirectory — wp-content/uploads/upf-docs/ (main site) and
wp-content/uploads/sites/N/upf-docs/ (subsite N) — with no per-user
isolation. Access control is not on the directory; it lives in PHP
(dl-file.php: 403 for anonymous users, then an author/allow-list check) and
is reached only through a rewrite emitted at plugin activation into the root
.htaccess:
# appended by 2.1.9 (upvf_actdeact.php), AFTER the WordPress block
RewriteRule ^wp-content/uploads/upf-docs/(.*)$ https://site/?file=$1 [QSA,L]
On multisite this never fires, for two independent reasons:
The network .htaccess short-circuits existing files first. WordPress
multisite writes its own ruleset into the root .htaccess:
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
A request mapping to a physically existing file ends rewriting right
there — Apache serves it as static content, and mod_rewrite never reaches
the plugin's block at the end of the file. (Single-site WordPress uses
negative conditions !-f/!-d, which is why the same plugin does work
there.) This already exposes files of the main site of the network.
Subsite paths do not match the pattern at all. On multisite each site
has its own uploads — wp-content/uploads/sites/N/…, plus the /siteN/
URL prefix in subdirectory networks — while the rule is hardcoded to
^wp-content/uploads/upf-docs/ from the main site's base URL. Even after
the network's internal rewrite strips the /siteN/ prefix, the sites/N/
segment still does not match.
So for any multisite network (subdirectory and subdomain alike) an unauthenticated attacker fetches private files directly:
GET /wp-content/uploads/upf-docs/victim.pdf HTTP/1.1 (main site)
GET /site2/wp-content/uploads/sites/2/upf-docs/victim.pdf HTTP/1.1 (subsite)
The response is 200 with the file body — served by Apache straight from
uploads/, the plugin's access check is never executed.
Nothing about the URL is secret. The plugin builds names from the owner's numeric user id and the unix-second of the upload:
| Generator (2.1.9) | On-disk name |
|---|---|
modern UI, inc/functions-file.php:73-77 | usr{ID}_{unixtime}_{original} |
classic template, inc/classic-user-functions.php | user_{ID}_doc_{unixtime}.{ext} |
User ids on a multisite network are small sequential integers from one shared
wp_users table, so an attacker needs only a rough upload time (a ±2 minute
window is ≈240 requests) and either the original filename or just its
extension. Collision suffixes (-1, -2) exist but are rare.
Version 2.2.0 replaced the root-file rewrite with a folder-level
upf-docs/.htaccess — RewriteRule ^(.*)$ {home}/?file=$1 [R=302,QSA,L],
plus Require all denied when mod_rewrite is absent — recreated on every
admin_init (self-healing, per subsite). A per-directory rule fires for any
physical path under upf-docs/ regardless of the URL prefix, so the direct
GET now becomes a 302 to the access check and, for anonymous users, a
403. Files are not moved; only the interception mechanism changes. That
302-vs-static distinction is also what the exploit uses as a behavioural
detector.
.htaccess
and the file was writable at activation (nginx needs the vendor's manual
rewrite — see plugin readme).exploit.py is pure Python 3 standard library (http.client), follows no
redirects, and sends no cookies:
GET /wp-content/plugins/user-private-files/readme.txt, parse Stable tag:.
< 2.2.0 → proceed; >= 2.2.0 → red NOT VULNERABLE - plugin 2.2.0+ (patched) box and exit code 6. If readme.txt is unreadable, a
behavioural probe of a nonexistent upf-docs/ name (302 = rewrite in
place, 404 = static delivery) is shown and the run continues
(--skip-check disables the whole step).{base}/wp-content/uploads/upf-docs/{file}
or, with --site site2 --site-id 2,
{base}/site2/wp-content/uploads/sites/2/upf-docs/{file}.GET, no Cookie, no Authorization.200 → * LEAKED with the first lines of the file as proof, exit 0;302 → "redirected to the access check - not vulnerable / patched", exit 1;404 → "file not found (wrong name?)" — try --guess, exit 1.--guess mode enumerates the predictable name patterns instead of one fixed
name: --user-id 2 --orig-name "Invoice 2026.pdf" --around <unixtime> --window 120 generates usr2_{t}_Invoice-2026.pdf and
user_2_doc_{t}.pdf for every second in the window and reads every name that
answers 200.
Exit codes: 0 file disclosed · 1 not disclosed (404 / 302 / 403) ·
6 not vulnerable (version check) · 4 network error.