CVE-2019-7238: Insufficient Access Controls in Sonatype Nexus Repository Manager 3 Allows Remote Code Execution

Spy Wrist Watch 32GB Mini Hidden Camera Record Video Audio DVR DV Camcorder US

$28.27
End Date: Sunday Oct-27-2019 15:18:16 PDT
Buy It Now for only: $28.27
Buy It Now | Add to watch list

32GB 64GB 128GB Micro Class10 TF Card+DVR Cam Hidden Spy Pen Camera Recorder

$11.78
End Date: Saturday Nov-2-2019 20:08:23 PDT
Buy It Now for only: $11.78
Buy It Now | Add to watch list

By Govind Sarda and Raghvendra Mishra

A critical remote code execution (RCE) vulnerability (CVE-2019-7238) was found in Sonatype’s Nexus Repository Manager (NXRM) 3, an open source project that allows developers, such as DevOps professionals, to manage software components required for software development, application deployment, and automated hardware provisioning. This vulnerability in NXRM 3, which reportedly has over 150,000 active installations, was discovered by @Rico of Tencent Security Yunding Lab and @voidfyoo of Chaitin Tech.

Analysis of CVE-2019-7238 reveals that the exploitation of the security flaw doesn’t require authentication. This makes it easier for attackers to send crafted requests to and execute arbitrary codes or programs on the host server. Sonatype has already released a patch for the vulnerability in NXRM 3.15 versions and above on January 11, 2019.

Lack of Proper Access Control Methods Results in Remote Code Execution

CVE-2019-7238 is an Expression Language injection vulnerability. It resulted from the unsanitized evaluation of a CSEL (Content Selector Expression Language) expression in the previewAssets function. CSEL is a light version of JEXL (Java Expression Language) that is used to script queries along specific paths and coordinates available to repository manager formats.

In our analysis, we observed that previewAssets() takes the vulnerable parameter as the value of the expression property in the previewAssets request. Subsequently, this function calls the checkJexlExpression() method, and then the execute() method in ContentExpressionFunction.java, without sanitizing the provided expression value. The execution of arbitrary code can take place after this.

A sample of a previewAssets request is shown in Figure 1, where the “method” key is set to “previewAssets,” the “property” key is set to “expression,” and the “value” key contains malicious code (highlighted in the snippet below). When sent to NXRM 3, this will then lead to remote code execution due to missing proper access control methods.

Figure 1. Snippet of previewAssets JSON request

Figure 1. Snippet of previewAssets JSON request

How the Vulnerability Is Exploited and Patched

To exploit this vulnerability, the following conditions need to exist:

  • The NXRM 3 server version is below 3.15.
  • There is a file in any of the repositories present in NXRM 3 (see Figure 2).

Figure 2. Existing repositories in NXRM 3

Figure 2. Existing repositories in NXRM 3

After verifying the abovementioned prerequisites, an attacker can exploit the vulnerability to gain control over a remote machine.

Figure 3. Execution of a reverse shell on a remote host

Figure 3. Execution of a reverse shell on a remote host

To patch CVE-2019-7238, increased permission requirements should be set up. The updated code highlighted in Figure 4 implements permission check on imported registries in NXRM 3 before the previewAssets() function is called. This is achieved using @RequiresPermissions(‘nexus:selectors:*’), an interface from the Java class file org.apache.shiro.authz.annotation.RequiresPermissions.

Figure 4. Patching CVE-2019-7238

Figure 4. Patching CVE-2019-7238

Recommendations and Trend Micro Solutions    

Repository managers such as NXRM 3 are tools that software developers can use for speed and efficiency. However, as evidenced by vulnerabilities like CVE-2019-7238, such tools can also be susceptible to abuse. This highlights the need for continuous monitoring in software development, which involves identifying vulnerabilities and making use of the latest threat intelligence against malware or exploits that take advantage of security flaws. To determine if risks are being introduced through third-party components, automated security can be implemented to uncover and address them.

The Trend Micro™ Deep Security™ solution protects systems from attackers that could exploit CVE-2019-7238 via the following deep packet inspection (DPI) rule:

  • 1009553 – Sonatype Nexus Repository Manager Remote Code Execution Vulnerability (CVE-2019-7238)

Meanwhile, Trend Micro™ TippingPoint™ customers are protected from the vulnerability via this MainlineDV filter:

  • 34706 – HTTP: Sonatype Nexus Repository Manager Code Injection Vulnerability

The post CVE-2019-7238: Insufficient Access Controls in Sonatype Nexus Repository Manager 3 Allows Remote Code Execution appeared first on .

2019 ESET NOD32 Antivirus 2019 -3 Computers 3 years - Instant Delivery via Email

$5.99
End Date: Wednesday Nov-13-2019 11:46:44 PST
Buy It Now for only: $5.99
Buy It Now | Add to watch list

KASPERSKY INTERNET SECURITY 2020 1 PC DEVICE 1 YEAR BEST ANTIVIRUS LICENSE

$4.19
End Date: Monday Oct-28-2019 8:34:02 PDT
Buy It Now for only: $4.19
Buy It Now | Add to watch list