Eat What You Kill :: Pre-authenticated Remote Code Execution in VMWare NSX Manager
VMware NSX Manager used a vulnerable version of XStream (1.4.18) to deserialise XML request bodies on a pre-authenticated password reset endpoint, allowing an unauthenticated attacker to send a crafted XML payload that triggers remote code execution as root.
Published on srcincite.io
VMWare NSX Manager is vulnerable to a pre-authenticated remote code execution vulnerability and at the time of writing, will not be patched due to EOL this was patched in VMSA-2022-0027. The following blog is a collaboration between myself and the Steven Seeley who has helped me tremendously along the way.
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 application deserialised untrusted XML input using a vulnerable version of XStream (1.4.18) on an endpoint that was accessible without authentication.
Impact
An unauthenticated attacker could execute arbitrary commands on the NSX Manager appliance as the root user.
What the attacker needed
Network access to the NSX Manager; no authentication required
The fix
The vulnerability was patched in VMSA-2022-0027; the text does not describe the fix method.
How it was found
- Identify that the password reset endpoint accepts a SecurityProfileDto request body, which is deserialised by XStream.
- Confirm the endpoint is pre-authenticated because the security configuration marks it as anonymous.
- Craft an XStream XML payload using a TreeSet with a dynamic proxy and EventHandler to invoke ProcessBuilder.start.
- Send the payload to the password reset endpoint to execute arbitrary commands as root.
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.
XStream is a Java library that turns XML into Java objects. If an attacker can control the XML, they can make XStream create dangerous objects that run commands. Here, a password reset endpoint accepted XML without requiring login, so anyone could send a malicious XML body and run commands on the server as the root user.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.