[Blog] Liferay Portal JSON Web Service RCE Vulnerabilities
Two JSON deserialisation flaws in Liferay Portal's JSON web services API let an unauthenticated attacker instantiate arbitrary classes and call their setter methods, which can lead to remote code execution using publicly known gadgets. The first is in the Flexjson deserialiser used in versions 6.1 and 6.2, and the second is in Liferay's own parameter map in version 7.
code-white.com
Published on code-white.com
Code White has found multiple critical rated JSON deserialization vulnerabilities affecting the Liferay Portal versions 6.1, 6.2, 7.0, 7.1, and 7.2. They allow unauthenticated remote code execution via the JSON web services API.
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 deserialiser trusted a class name supplied by the request (via a 'class' key in Flexjson, or a ':' suffix on a parameter name in Liferay's parameter map) and instantiated it and called its setters without restricting which classes are allowed.
What the attacker needed
Network access to /api/jsonws; unauthenticated JSONWS access enabled; publicly known gadget classes available
The fix
It was fixed in 6.2 GA6, 7.0 GA7, 7.1 GA4 and 7.2 GA2 by using a whitelist of allowed classes.
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.
Liferay Portal is a product for building websites and intranets, and it has a web service that accepts data in JSON, a common text format for sending structured data. The code that turns that JSON back into program objects was too trusting: it let the sender name any class to create and then call its setter methods, which are small functions that assign values. Attackers can chain such calls into a known sequence that runs their own commands on the server, without logging in.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.