Log4j

From Archivematica
Revision as of 11:11, 15 December 2021 by Sromkey (talk | contribs) (→‎Atom)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Home > Release Notes > Log4j vulnerability information

  • Posted: 2021-12-13
  • Last updated: 2021-12-15

Below is the latest information and recommendations we have about CVE-2021-44228, colloquially called the "Log4Shell" vulnerability found in Apache Log4j in December of 2021.

What is this issue that everyone seems to be talking about?[edit]

From LunaSec, one of the first companies to write about the vulnerability:

On Thursday (December 9th), a 0-day exploit in the popular Java logging library log4j (version 2) was discovered that results in Remote Code Execution (RCE) by logging a certain string.

Given how ubiquitous this library is, the impact of the exploit (full server control), and how easy it is to exploit, the impact of this vulnerability is quite severe. We're calling it "Log4Shell" for short.

The 0-day was tweeted along with a POC posted on GitHub. It has now been published as CVE-2021-44228.

While full server control is the worst possible outcome, the vulnerability could lead to information disclosure or other remote code execution as well. Since the above post was made on December 12th, 2021, the "Log4Shell" name for this vulnerability has been generally adopted (though it is also sometimes referred to as "LogJam").

Another explanation from Ars Technica:

Log4J is an open source Java-based logging tool available from Apache. It has the ability to perform network lookups using the Java Naming and Directory Interface to obtain services from the Lightweight Directory Access Protocol. The end result: Log4j will interpret a log message as a URL, go and fetch it, and even execute any executable payload it contains with the full privileges of the main program. Exploits are triggered inside text using the ${} syntax, allowing them to be included in browser user agents or other commonly logged attributes.

...The vulnerability, tracked as CVE-2021-44228, has a severity rating of 10 out of 10. The zero-day had been exploited at least nine days before it surfaced.

What does Log4j have to do with Elasticsearch?[edit]

Elasticsearch is the search index library used in AtoM and Archivematica to support indexing, browsing, and search functionality.

Elasticsearch uses the Log4j library to handle logging. Even if you have not actively configured additional logging, the package will have been installed when installing Elasticsearch as part of your AtoM or Archivematica installation.

For more detailed information from the Elastic team, see:

What does Log4j have to do with Java?[edit]

Log4j is a Java based tool. Java is a programming language and computing platform first released by Sun Microsystems in 1995, and currently maintained by Oracle. Java is a general term used to denote both the software and its components, which include 'Java Runtime Environment' (JRE), 'Java Virtual Machine' (JVM) and also 'Plug-in'.

The vulnerability is not caused by Java directly, but rather how Log4j handles requests. However, ensuring you have the most up-to-date version of Java installed is always a good idea, and the Oracle Java website also includes further general tips for ensuring the security of your Java installation:

You can review Oracle’s announcement about this vulnerability on their blog, here:

Do I need to do anything about this? Am I vulnerable?[edit]

If you are an Artefactual hosted client, or if you have a maintenance agreement with Artefactual, then there is nothing you need to do - hosted clients have already been patched, as have most maintenance clients - if Artefactual needs to coordinate with you for support access and/or patching, our team will be in touch shortly if they have not been already.

If you are using a different hosting provider, we recommend that you contact them to verify that this issue is being addressed.

If your organization is hosting your own AtoM installation, then yes: you will need to ensure that your server is patched against the vulnerability to prevent information leakage.

What has Artefactual done about this vulnerability?[edit]

Our team has been monitoring all developing information, and using it to perform our own penetration tests to determine both the severity of the issue, as well as ensure that the recommended patch solutions correctly resolve the vulnerability.

Based on these findings, our team has already patched all Artefactual-hosted applications (and most maintenance agreement installations) affected by this vulnerability, and are in the process of coordinating with any locally maintained installation owners with a maintenance agreement where communication is required to perform the necessary patching.

We will continue to monitor developments, perform our own tests to ensure that any proposed solutions do in fact resolve the issue, and will be keeping a close eye on the logs for all hosted and maintained installations.

To support our user community, we have also prepared this FAQ with guidance on how best to secure your local installation.

Can my AtoM or Archivematica instance end up running dangerous executable code because of this?[edit]

Fortunately, the risk of this occurring appears to be low. There is some risk of information leakage, but based on current public sources as well as our own internal penetration testing thus far, currently it appears there is a very low risk that it’s possible to trigger executable code via an Elasticsearch query with this vulnerability.

As the Elastic team reports:

Elasticsearch is not susceptible to remote code execution with this vulnerability due to our use of the Java Security Manager. Elasticsearch on JDK8 or below is susceptible to an information leak via DNS which is fixed by a simple JVM property change. The information leak does not permit access to data within the Elasticsearch cluster. We will also release a new version of Elasticsearch that contains the JVM property by default and removes certain components of Log4j out of an abundance of caution.

However, this is clarified later with:

Elasticsearch 6 and 7 are not susceptible to remote code execution with this vulnerability due to our use of the Java Security Manager. Investigation into Elasticsearch 5 is ongoing.

At this time, AtoM 2.6.0 and later versions use Elasticsearch 5.6.

Additionally, most Archivematica installations are not publicly accessible, further reducing the likelihood of a successful attack using this vulnerability.

Despite the above, this is a developing situation and, we still strongly recommend that all AtoM and Archivematica users patch the vulnerability as soon as possible.

What is the recommended fix for this vulnerability?[edit]

If we discover further information that contradicts the current recommendations, we will edit this page with updates and links to further sources.

In the meantime, based on the different versions of Elasticsearch used in AtoM and Archivematica, below are the least disruptive ways we have found to ensure your installation is no longer vulnerable:

Archivematica[edit]

  • First, upgrade to the latest version of Elasticsearch v6.x

Then proceed to follow the instructions on Step 4 on this guide:

In short, as root:

  • Edit /etc/default/elasticsearch (Debian/Ubuntu) or /etc/sysconfig/elasticsearch (RedHat/CentOS) and find the line with your ES_JAVA_OPTS, and append this option to the end of it:

-Dlog4j2.formatMsgNoLookups=True

It should look something like this:

ES_JAVA_OPTS="-Xms2g -Xmx2g -Dlog4j2.formatMsgNoLookups=True"

  • Restart the ElasticSearch service with: service elasticsearch restart

Atom[edit]

Please follow the instructions on the AtoM wiki.

Where can I get more technical information for my IT team?[edit]

CVE: CVE-2021-44228

(Learn more about what a CVE is here and here)

Some sources we have found to be reliable and regularly updated: