Difference between revisions of "Development/Security/Log4j-2021-12"
(Add initial page content) |
(No difference)
|
Revision as of 16:06, 13 December 2021
Main Page > Development > Development/Security > Development/Security/Log4j-2021-12
- Posted: 2021-12-13
- Last updated: 2021-12-13
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.
Contents
- 1 What is this issue that everyone seems to be talking about?
- 2 What does Log4j have to do with Elasticsearch?
- 3 What does Log4j have to do with Java?
- 4 Do I need to do anything about this? Am I vulnerable?
- 5 What has Artefactual done about this vulnerability?
- 6 Can my AtoM or Archivematica instance end up running dangerous executable code because of this?
- 7 What is the recommended fix for this vulnerability?
- 8 Where can I get more technical information for my IT team?
What is this issue that everyone seems to be talking about?
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?
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?
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?
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?
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?
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?
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
Please 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 change the ES_JAVA_OPTS line to look like this:
ES_JAVA_OPTS="-Xms2g -Xmx2g -Dlog4j2.formatMsgNoLookups=True"
- Restart the ElasticSearch service with:
service elasticsearch restart
Atom
Please follow the instructions on Step 5 of this guide:
In short, as root:
- Install the zip package:
apt-get install zip
(Debian/Ubuntu) oryum install zip
(RedHat/CentOS) - Change directories:
cd /usr/share/elasticsearch/lib/
- Run the following line to remove the problematic file:
zip -q -d log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class
- Restart the ElasticSearch service with:
service elasticsearch restart
Where can I get more technical information for my IT team?
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:
- Elastic security announcement on CVE-2021-44228, December 10, 2021
- Apache Log4j security announcement page
- LunaSec blog post on Log4Shell, December 12, 2021
- Oracle Security blog announcement on CVE-2021-4428, December 10, 2021