Skip to content
Path traversal Write-up Intermediate

Unauthorized RCE in VMware VCenter

An unauthenticated file upload vulnerability in VMware vCenter's vropspluginui plugin allowed uploading arbitrary files via path traversal in tar archive entries, leading to remote code execution on both Windows and Linux. An attacker could upload a JSP shell to a web-accessible directory on Windows or an SSH key to the vsphere-ui user's home directory on Linux to execute commands.

swarm.ptsecurity.com

Published on swarm.ptsecurity.com

In fall of 2020, I discovered couple vulnerabilities in the vSphere Client component of VMware vCenter. These vulnerabilities allowed non-authorized clients to execute arbitrary commands and send requests on behalf of the targeted server via various protocols:

The author, on swarm.ptsecurity.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The upload handler concatenated tar entry names directly to a base directory without sanitising path traversal sequences, and the plugin allowed unauthenticated access to the upload endpoint.

Impact

An unauthenticated attacker could execute arbitrary commands on the vCenter server, potentially with SYSTEM privileges on Windows or as the vsphere-ui user on Linux.

What the attacker needed

Network access to vCenter; no authentication required

The fix

The vulnerability was fixed in the February 2021 update; the plugin should require authentication and sanitise tar entry names.

How it was found

  1. Send an unauthenticated request to the upload endpoint with a crafted tar archive containing a file with a path traversal name.
  2. Verify the file was written to the intended location on the server.
  3. On Windows, upload a JSP shell to a web-accessible directory that allows unauthenticated execution.
  4. Access the uploaded JSP shell to execute commands with SYSTEM privileges.
  5. On Linux, generate an SSH key pair and upload the public key to the vsphere-ui user's .ssh directory.
  6. Connect to the server via SSH using the private key to gain command execution as vsphere-ui.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

The vCenter web interface had a file upload feature that didn't check who was using it. The uploaded file was a tar archive, and the names inside the archive weren't checked, so someone could use '../' to write files anywhere on the server. This let an attacker place a malicious script or key that gave them control of the server.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.