
PoC lab for CVE-2026-124552: Webmin <=2.670 stored XSS in Shorewall list.cgi chained to root RCE, plus an unpatched path traversal arbitrary file write, with vulnerable and patched containers.
Webmin through 2.670 — stored XSS in the Shorewall and Shorewall6 modules' list.cgi (fixed post-2.670 by upstream commit 01b988dbf).
Any Webmin account that is granted the Shorewall module can persist arbitrary HTML/JavaScript into a firewall table (a comment via savecmt.cgi, or any rule field via save.cgi). When an administrator later opens list.cgi for that table, the stored values are rendered without html_escape(), so the payload executes in the administrator's browser session. Webmin runs as root, so the injected script can drive any Webmin endpoint with the admin's credentials — the PoC turns this into command execution as root via the Command Shell module.
Fix (commit 01b988dbf, webmin/webmin#2908): list.cgi in both modules now HTML-escapes every table cell and comment before rendering, and savecmt.cgi rejects carriage returns/NULs in the comment text.
Podman network cve124552lab; every container is bounded (--cpus 2 --memory 4g).
| container | role |
|---|---|
webmin-vuln | Webmin 2.670 + shorewall/shorewall6 (vulnerable) |
webmin-fixed | Webmin 2.670 with upstream patch 01b988dbf applied (control) |
| poc runner (ephemeral) | Python + Playwright Chromium; drives the whole chain over the lab network |
Default lab credentials: admin root / webminroot, unprivileged attacker / attackerpass (granted the Shorewall module only — the stand-in for an untrusted account).
make prepare # build the three images
make up # create the network + start webmin-vuln / webmin-fixed
make poc-vuln # check + exploit against webmin-vuln -> VULNERABLE / EXPLOIT SUCCESS
make poc-fixed # same against webmin-fixed -> NOT VULNERABLE / no marker
make 0day # traversal write PoC against both -> 0DAY CONFIRMED (both)
make down
PoC modes (poc/poc.py, run inside the poc runner container):
| mode | what it does | proof |
|---|---|---|
check | attacker stores an `` canary comment; admin fetches list.cgi?table=rules | canary rendered raw → VULNERABLE; only escaped → NOT VULNERABLE |
exploit | same storage step, then headless Chromium logs in as admin and opens list.cgi — the stored JS fires | JS POSTs a command to /shell/index.cgi; marker /tmp/pwned_by_cve_2026_124552 appears with uid=0(root) |
0day | see below | arbitrary file created on the target as root via the Shorewall module |
evidence/check-vulnerable-run.txt — check against 2.670: payload rendered unescaped.evidence/check-patched-run.txt — same against the patched build: payload HTML-escaped.evidence/exploit-vulnerable-run.txt — full chain against 2.670: XSS fires, marker file contains uid=0(root) gid=0(root) groups=0(root).evidence/exploit-patched-run.txt — same against the patched build: payload escaped, no marker.evidence/0day-vulnerable-run.txt / evidence/0day-patched-run.txt — traversal write works on both builds.Unpatched path traversal → arbitrary file write as root. (Fixed upstream by 1b899205 for the shorewall module and f918d37 for shorewall6 + comment validation; both verified against the PoC in this repo.) The table parameter of the Shorewall/Shorewall6 module was used verbatim in file paths (read_table_file, create_table_row, modify_table_row), while can_access() returned true for any value because the module's default ACL is files=*. savecmt.cgi never validated table and (before f918d37) only rejected \r/\0 in the message - a newline was accepted. Consequences for any account with Shorewall module access (Webmin runs as root):
savecmt.cgi with new=1 creates a new file anywhere: table=../../../../tmp/proof&msg=... → ?COMMENT ... written as root.savecmt.cgi modify mode + %0a in msg replaces a line of any root-writable file, or splices in extra lines. Example against /etc/passwd: table=../../../../etc/passwd&idx=0&msg=x%0aroot::0:0:root:/root:/bin/bash appends a passwordless root line.editcmt.cgi reads back files whose lines are whitespace-separated (the edit form shows fields 2..N of a line, HTML-escaped but intact).The nochange ACL flag does not gate any of this — it is only consulted by the start/stop/restart/clear buttons (R4 of the disclosure; still open). The 0day mode of the PoC demonstrates the primitive safely: it creates /tmp/0day_124552_proof.txt as root, reads it back through editcmt.cgi, then deletes the inserted line.
Vendor timeline: reported 2026-11-09; 1b899205 (shorewall module guard) and f918d37 (shorewall6 guard + \n rejection in both savecmt.cgi) landed the same week; re-tested against 2.670 + 1b899205 + f918d37 - all vectors in this PoC are blocked ("Invalid table name" / newline rejected) with no regression on legitimate comments.
Exploit-chain details worth knowing:
testing=1 cookie (handle_login in miniserv-lib.pl) and same-origin Referer headers (referers_none=1 default; a missing referer yields the "Security Warning" interstitial). The PoC sets both./shell/index.cgi only parses multipart/form-data (ReadParseMime requires a boundary), so the injected script POSTs a FormData body; command output is HTML-escaped (uid=0(root)), so the verifier unescapes before matching.onerror on parse.01b988dbf).1b899205 + f918d37; on older releases, module access implies full root control./usr/share/webmin on hosts where the module is unused.