News and Notes from the Makers of Nexus | Sonatype Blog

Sonatype Nexus Security Advisory

Written by Brian Fox | January 16, 2014

Sonatype Nexus Security Advisory

Date: January 14, 2014

Affected Versions: Nexus OSS/Pro versions prior to and including 2.7.0-06

Summary:

A critical security vulnerability has been discovered by Sonatype in Nexus requiring immediate action. The vulnerability makes use of an execution path in an open source library that we have now (with the available patch) added a mitigating control for. This advisory provides the pertinent information needed to properly mitigate this vulnerability, along with the details on how to reach us if you have any further questions or concerns.

We identified this vulnerability during our security research activities and are not aware of any active exploits taking advantage of this issue. However, we strongly encourage all users of Nexus to immediately take the steps outlined in this advisory.

The identified vulnerability can allow an attacker controlled remote object creation and arbitrary code execution in the running Nexus instance without requiring user authentication. Although not every version of Nexus has been proven to allow for arbitrary code execution and object creation we are still considering the possibility that such a condition may exist, and we are highly recommending all instances of Nexus have the patch, detailed in this advisory, applied.

We are taking steps to mitigate this vulnerability in public forge instances and are also providing remediation guidance to the overall Nexus user community. We are currently coordinating with NIST as part of the vulnerability disclosure process and further details will become publicly available as soon as that process is complete. The placeholder identifier for this vulnerability is CVE-2014-0792.

The vulnerability is fixed in Nexus 2.7.1, which can be downloaded from the links below:

If you want to patch an existing instance to address this vulnerability see below.

Compatibility of Patch:

This patch can be installed on any Nexus 2.x version. If you are running a 1.x version of Nexus you must upgrade before applying this patch. For detailed information on upgrade compatibility, please see:

The latest versions of Nexus can be found here:

OSS: http://www.sonatype.org/nexus/go
Pro: https://support.sonatype.com/entries/20673111

Archived 2.x releases can be found here:

OSS: http://www.sonatype.org/nexus/archived
Pro: https://docs.sonatype.com/display/SPRTNXPRO/Downloads

This patch works by building a white-list of allowed classes which can be instantiated. This mechanism will cover all Nexus use cases, but it may not cover all third party (non-Sonatype) Nexus plugins. We advise testing the patch in a non-production instance if you are using third party plugins.

If there is an issue related to the patch it will manifest itself in response to HTTP requests failing with error 400. In the logs you will see a message such as the following:

WARN: ...whitelist.TypeWhitelist - Type NOT allowed: <classname>

ConversionException: No converter specified for class <classname>

If you encounter this error see the Configuration section below for instructions on how to remedy the problem.

Installation:

To install this patch, download xstream-1.4.6-SONATYPE-02.jar [sha1] [md5] then:

  1. Copy xstream-1.4.6-SONATYPE-02.jar into $NEXUS_HOME/nexus/WEB-INF/lib/
  2. Shut down Nexus
  3. Remove the old $NEXUS_HOME/nexus/WEB-INF/lib/xstream-<version>.jar
  4. Start Nexus

After successful installation you will see a message like this in the $NEXUS_HOME/logs/wrapper.log file:

2014-01-07 14:43:47 INFO [jetty-main-thread-1] - com.thoughtworks.xstream.XStream - Version: 1.4.6-SONATYPE, white-list support available

Note: The message is logged too early to be seen in the nexus.log file

Configuration:

If you are using plugins which are not supplied by Sonatype that register with xstream in a non-standard way it may be necessary to extend the whitelist. Please see the configuration article for instructions.

Support:

If you run into any problems, or have any questions/concerns, please contact us. You can do this by filing a ticket at https://support.sonatype.com, or sending an email to support@sonatype.com.

Frequently Asked Questions:

Q: What is the risk associated with this vulnerability?
A: Nexus can be compromised, allowing an attacker to execute arbitrary code or allow for arbitrary class instantiation. The compromise is limited to the boundaries of privileges of the Nexus server process. This implies an attack could result in tampering or otherwise exfiltrating data from the Nexus instance.

Q: What preconditions must be met in order to be vulnerable?
A: An attacker must have network access to the Nexus instance. Therefore, internet accessible instances of Nexus imply available access by very a large audience versus the more limited audience associated with non-internet accessible instances. Nexus 2.7.0 is known to be vulnerable to arbitrary code execution and other versions may be. All versions are subject to arbitrary class instantiation, which could lead to system compromise.

Q: Are there implications associated with this advisory itself?
A: Public disclosure unfortunately means bad actors may try to take advantage. While we have initially limited the information to the minimum details necessary for users to affect an appropriate fix, this merely slows down a would be attacker. As such, we are advising all organizations utilizing Nexus to immediately assess their individual impact and take appropriate action in response.

Q: Where can I obtain more information associated with the vulnerability?
A: Sonatype will be releasing details of this vulnerability as part of a standard CVE disclosure process. At this time, and in the interest of best protecting our user community, we are limiting the information released to that absolutely required in order to assess impact and affect remediation.

Q: How did Sonatype discover this vulnerability?
A: The vulnerability was identified during our internal security research activities. Specifically, this was not in response to known attacks, and therefore allowed for a proactive response.

Q: Was Sonatype’s CLM platform used in response to this vulnerability?
A: Yes. In this particular case, the open source component at the core of the issue may not be vulnerable in and of itself. This debate is still ongoing. At a minimum though, certain uses could result in exposing a vulnerability, and we found this to be the case in Nexus. While CLM did not alert us to a particular vulnerability, it was used to identify the applications within our overall portfolio that were using this particular component and pinpoint the locations requiring further investigation. If it is decided that the underlying component is in fact vulnerable, that information will be added to the CLM feed and thus all customers using this component would receive an alert about their own potential vulnerability via the CLM platform.

Q: Why is Sonatype making this information publicly available?
A: This is part of a responsible disclosure process. Given Nexus is an open source project used by over 20,000 organizations worldwide, notifying the user base will invariably lead to broad dissemination. We are taking a concerted and proactive approach in our outreach activities and an effort to achieve the most rapid remediation possible.

Q: How can I be sure I am notified of new advisories in the future?
A: Sonatype periodically publishes vulnerability announcements for popular components as part of our CLM security research. Any notable alerts on Sonatype products will also be published to this list. You may subscribe to this low volume advisory list here: http://www.sonatype.org/advisories/subscribe/