Skip to content
RCE Write-up Advanced

Why Every Scanner Missed This RCE: Reviving CVE-2020–7961 On A

A Liferay Portal instance vulnerable to CVE-2020-7961 could not be exploited with the standard public payload because the C3P0 class used crashed the server thread. The authors found an alternative C3P0 class that avoided the crash and achieved pre-authentication remote code execution, then used response timing to extract command output despite an egress firewall.

Phil Follow

Published on infosecwriteups.com

During a bug bounty collaboration, we found a Liferay Portal instance hiding in plain sight on a manufacturing subdomain. A quick fingerprint gave us everything we needed:

Phil, on infosecwriteups.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

Likely the JSONWS endpoint deserialises attacker-controlled JSON with Jodd's +type hint, allowing instantiation of arbitrary classes; the standard C3P0 gadget crashes under OSGi, but another C3P0 class with the same deserialisation trigger avoids the crash.

What the attacker needed

Liferay Portal 7.1.2 (vulnerable version); JSONWS API accessible; No authentication required

The fix

The vulnerability was fixed in Liferay 7.2.1; the report does not state whether the specific instance was patched.

How it was found

  1. Fingerprint the Liferay version and confirm the JSONWS service catalog is accessible.
  2. Send a standard CVE-2020-7961 payload using WrapperConnectionPoolDataSource and observe HTTP 000 (connection reset).
  3. Enumerate C3P0 classes to find one that does not crash, identifying ComboPooledDataSource.
  4. Send a payload with ComboPooledDataSource and a hex-encoded serialized object, ensuring the trailing semicolon is present, and observe a delayed response indicating code execution.
  5. Use Thread.sleep in the payload to confirm timing-based code execution.
  6. Extract command output character by character via response timing, and verify file write by touching a file and listing it through the timing channel.

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.

This is about a known security flaw in Liferay, a web portal product, that lets an attacker run their own code on the server without logging in. The usual public exploit crashed the server instead of working, so the authors tried a different class from the same library and got it to work. They then used the time it took for the server to respond to read back the output of commands, because the server was not allowed to make outbound connections.

What is RCE?

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

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.