News broke early Friday morning of a serious 0-day Remote Code Execution exploit in log4j – CVE-2021-44228– the most popular java logging framework used by Java software far and wide. This type of vulnerability is especially dangerous as it can be used to run any code via your software and requires very low skills to pull off from an attacker. Log4j is near ubiquitous in Java applications, so immediate action is needed from software maintainers to patch. 

This affects anyone using log4j to perform logging, and anyone using software that uses log4 which is a large population of enterprise Java software currently available.

A similar vulnerability was used in the famous Equifax hack with devastating results. What makes this issue potentially more dangerous is the wide adoption of log4j in most of the Java ecosystem.

What is the Log4j Exploit? 

Early Friday morning GMT a vulnerability Proof of Concept was published in a github repository and made public. 

It affects Apache log4j between versions 2.0 and 2.14.1 and according to some sources, only on JDK versions below 6u211, 7u201, 8u191 and 11.0.1 . Coordinated with this release, Apache published a fix to the issue.

This is a low skilled attack that is extremely simple to execute. It allows the attacker to run Arbitrary Code on any application that is vulnerable and use this capability to execute an attack. Compared to the famous 2017 Struts2 CVE that led to the Equifax vulnerability this issue is potentially more far reaching, as log4j is a far more widely adopted component.

This vulnerability affects any application that uses log4j for logging – which includes software such as Minecraft, where we’ve already seen evidence of the vulnerability being exploitable using the built-in chat functionality.  It’s widely adopted in the enterprise Java software ecosystem, meaning you’ll need to also update all affected applications.

As with historical RCE attacks, within hours there is strong evidence this vulnerability is being mass scanned on the internet. This means immediate reactions are needed from all maintainers.

It only took less than 2 days for companies to be exploited with a similar vulnerability that occurred in 2017. 

CVE-2017-5638 timeline

How do I know if I’m affected

Sonatype has fast tracked the vulnerability and if you have scanned your software with Nexus Lifecycle you’ll receive automatic security alerts as a part of your usual continuous monitoring.

You can also run a manual search on Nexus Lifecycle to check if you’re affected. You can use the following REST API call to Nexus IQ server to find the affected Log4j versions:

"http://localhost:8070/api/v2/search/component?stageId=release&componentIdentifier={"format":"maven","coordinates":{"groupId":"org.apache.logging.log4j","artifactId":"*","version":"*","extension":"*","classifier":"*"}}"

Advanced search inside the Nexus IQ server can also be used: https://help.sonatype.com/iqserver/reporting/advanced-search

Finally, the community has published a script that allows you to check if your application is vulnerable. We recommend you perform both a search and conduct a test ASAP.

How do I mitigate the issue

The fixed version for this issue is out and was released by Apache – the main process is to upgrade log4j to the latest 2.15 version immediately. It is available via Maven Central.

The version is available immediately and was produced by the Apache foundation as soon as the vulnerability was disclosed to them in advance.

The vote to release was conducted in a fast track fashion and a release pushed out with urgency. 

Another mitigation according to different CERT reports is to

  • change configuration in your software by setting the following “log4j2.formatMsgNoLookups” -> true

Other potential mitigations could include upgrading the JDK underlying your software to non-affected versions.

Are Sonatype applications affected?

Sonatype uses logback as the default logging solution as opposed to log4j. We are conducting a deeper analysis of our usage of log4j in an abundance of caution.