From PostAuth RCE to PreAuth RCE on Liferay Portal
The author found a second endpoint in Liferay Portal that passes user input into the same JSON deserialisation routine that caused CVE-2019-16891, and this endpoint can be reached without logging in. An unauthenticated attacker could therefore send a crafted request to achieve remote code execution, raising the severity from a post-authentication issue to a pre-authentication one.
Liferay overriddendeserialize func when implementing JSONFactoryImpl class from com.liferay.portal.kernel.json.JSONFactory
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 Portlet URL action passes a user-supplied parameter map straight into the JSON deserialisation routine, which reaches the vulnerable jabsorb library without the whitelist protection applied elsewhere.
Impact
An unauthenticated attacker could achieve remote code execution on a vulnerable Liferay Portal instance, though the Portlet URL feature is turned off by default.
What the attacker needed
Portlet URL feature enabled; Liferay Portal 7.1.0 or earlier; No account needed
The fix
The text says the underlying deserialisation flaw was fixed in 2018 with a class whitelist, and recommends upgrading to Liferay Portal 7.1 CE GA2 or later, or applying the source patches for 7.0 and 6.2.
How it was found
- Search the source code for uses of the deserialisation function with user-controlled input.
- Identify the Portlet URL action endpoint as reachable without authentication.
- Send a POST request to that endpoint with a crafted parameter map containing the serialised payload.
- Confirm the instance is vulnerable by checking the endpoint returns a 200 status and the version is 7.1.0 or lower.
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.
Deserialisation is when a program turns stored data back into live objects; if an attacker controls that data, they can sometimes make the program build dangerous objects that run their code. Liferay had already fixed one place where this happened, but the author searched the source for other places using the same function and found one that did not require a login. That means anyone on the internet could try the attack, not just a logged-in user.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.