GraphDB Users Ask: Do You Have Any Advice on the Log4j Vulnerability for Different Versions of GraphDB?

GraphDB is Immune to Log4Shell aka "Log4J JNDI" Vulnerability

January 4, 2022 4 mins. read GraphDB Q&As

ONTOTEXT ANSWER:

A zero-day vulnerability is probably one of the most stressful situations for any operations team, especially when dealing with a vulnerability with the highest severity remote code execution (RCE). The situation is much worse if the vulnerable library (in this case Apache Log4j)  is widespread in thousands of applications such as Elasticsearch, Apache Solr, Apache SPARK and a very long list of commercial software using the same library.

This is exactly what happened this weekend with the announced CVE-2021-44228, where an attacker can force the targeted application via the log4j library to open a malicious JNDI server and load a class file supplied by the attacker.

What are the preconditions to exploit Log4Shell vulnerability?

The full extent of the vulnerability is still under revision. What we know so far is that the attacker can exploit it if:

  • The target application uses Apache Log4j from version 2.0-beta 9 up to version 2.14.1 – the check is pretty simple. You need to scan your jar for log4j-core.jar and match its version.
  • If you run a Java virtual machine lower than 8. The listed builds below are not directly affected, but still advisable to fix the vulnerability:
    • Java 8 – 8u192
    • Java 11 – 11.0.2

What is the impact on GraphDB software?

The simplest test to check if a Java application is affected by the vulnerability is to check its classpath. Note, this check may not work for every software application if the developers decided to apply the wrong practices of repackaging the JAR files, which is not the case in GraphDB.

graphdb-ee-9.10.1 find . -name '*log4j*' 
./lib/log4j-over-slf4j-1.7.31.jar
./lib/plugins/elasticsearch-connector/log4j-to-slf4j.jar
./lib/plugins/elasticsearch-connector/log4j-core.jar
./lib/plugins/elasticsearch-connector/log4j-api.jar

The quick test indicates that the GraphDB engine does not use Log4j since our logging framework is Logback (a reimplementation of Apache Log4j, which claims faster performance and better usability). The library `./lib/log4j-over-slf4j-1.7.31.jar` is a facade to Logback which routes all code expecting the Log4j classes to the safe Logback implementation.

Unfortunately, the code base of Elasticsearch Connector references the vulnerable log4j-core. After a quick git history test, we see that all GraphDB EE versions between 6.0-9.10 ship the vulnerable Apache Log4j version from 2.6 to 2.8. The deeper code analysis, however, shows that these libraries are used only in the very rare case of running the GraphDB Elasticsearch Connector outside of the database context i.e. only testing the compatibility between GraphDB and the different Elasticsearch server versions.

Our recommendation to all clients who are concerned about these libraries is that they can safely delete them since they will never be instantiated during standard database use. The only case to instantiate the included Apache Log4j is via an Ontotext provided test client, which is not shipped as part of the main codebase.

Conclusion

All GraphDB editions from 6.x to 9.x are completely immune to the reported Log4Shell vulnerability (CVE-2021-44228) because the database uses the Logback logging framework. Sadly, the GraphDB EE will fail during automatic checks because of the shipped Apache Log4j libraries distributed in the Elasticsearch Connector. This library is absolutely safe and will be instantiated only when the Connector is in Elasticsearch search compatibility test mode. This mode is not part of the GraphDB EE distribution and our team will remove these dependencies to prevent false positive alarms.

Did this help you solve your issue? Your opinion is important not only to us but also to your peers.

New call-to-action

 

Article's content

Ontotext answers questions from our GraphDB users. You can also check out the frequently asked questions on general topics about GraphDB. Or you can get quick answers on technical questions from the community as well as Ontotext experts using the graphdb tag on stack overflow.

GraphDB Users Ask: Where Can We Deploy GraphDB And What Are Some Best Practices?

In this blog, we answer questions from our GraphDB users. This question is about where can one deploy GraphDB and what are some best practices

GraphDB Users Ask: What Isolation Levels Does GraphDB Support?

In this blog, we answer questions from our GraphDB users. This question is about the the isolation levels GraphDB supports..

GraphDB Users Ask: What is the Most Important Hardware Attribute for Optimizing GraphDB Performance?

In this blog, we answer questions from our GraphDB users. This question is about the most important hardware attribute for optimizing GraphDB performance.

GraphDB Users Ask: What is the Best Way to Store the Triples’ History in the Database?

In this blog, we answer questions from our GraphDB users. This question is about the best way to store the triples’ history in the database

GraphDB Users Ask: Can I Use Nested Repositories to Introduce Logical Separation to GraphDB?

In this blog, we answer questions from our GraphDB users. This question is about using nested repositories to introduce logical separation to GraphDB

GraphDB Users Ask: Can I Fine-tune Security on Some of the Endpoints in GraphDB?

In this blog, we answer questions from our GraphDB users. This question is about fine-tuning securing on a GraphDB endpoint.

GraphDB Users Ask: What Are the Different Ways to Deploy GraphDB?

In this blog, we answer questions from our GraphDB users. This question is about the different ways to deploy GraphDB.

GraphDB Users Ask: What is the best way to integrate JSON data in GraphDB?

In this blog, we answer questions from our GraphDB users. This question is about the best ways to integrate JSON data in GraphDB.

GraphDB Users Ask: How Does GraphDB’s Security Work, Especially for Automated APIs?

In this feature, we answer questions from our GraphDB users. This question is about how about GraphDB security workds, especially for Automated APIs

GraphDB Users Ask: Is Kafka Only Used for Exporting Data, or for Importing, or Can We Do Both?

In this feature, we answer questions from our GraphDB users. This question is about if Kafka is used only for exporting or importing data or we can use for both

GraphDB Users Ask: How Do I Change the Configuration of an Existing Connector?

In this feature, we answer questions from our GraphDB users. Today’s question is about how to change the configuration of connector if you’ve made a mistake when creating it

GraphDB Users Ask: Are There Any Administration Differences to Operating a Cluster on GraphDB 10?

In this feature, we answer questions from our GraphDB users. Today’s question is about whether there are administration differences to operating a cluster in GraphDB 10

GraphDB Users Ask: Can I Scale GraphDB?

In this feature, we answer questions from our GraphDB users. Today’s question is if one can scale GraphDB.

GraphDB Users Ask: Can I Change My Inference At Runtime?

In this feature, we answer questions from our GraphDB users. Today’s question is if one can change inference at runtime.

GraphDB Users Ask: How To Mark Statements In A Query As Explicit Or Implicit?

In this feature, we answer questions from our GraphDB users. Today’s question is about how to mark statements in a query as explicit or implicit.

GraphDB Users Ask: Can I Use the Standard Ontop Configurations?

In this feature, we answer questions from our GraphDB users. Today’s question is if one can use the standard Onotp configurations.

GraphDB Users Ask: Should I Use a SPARQL Repository or a HTTP Repository?

In this feature, we answer questions from our GraphDB users. Today’s question us whether to use a SPARQL Repository or a HTTP Repository.

GraphDB Users Ask: Do You Have Any Advice on the Log4j Vulnerability for Different Versions of GraphDB?

In this feature, we answer questions from our GraphDB users. Today’s question is about the Log4j vulnerability for different versions of GraphDB.

GraphDB Users Ask 12 Very Short Questions

In this feature, we answer questions from our GraphDB users. Today, we answer 12 very short question from GraphDB users.

GraphDB Users Ask: Which of the GraphDB Logs Do I Need to Monitor for Problems?

In this feature, we answer questions from our GraphDB users. Today’s question is about GraphDB logs and how to monitor for problems.

GraphDB Users Ask: Can You Help Me Optimize My Queries?

In this feature, we answer questions from our GraphDB users. Today’s question is about how users can optimize their queries.

GraphDB Users Ask: What’s the Difference Between SPARQL and FedX Federation?

In this feature, we answer questions from our GraphDB users. Today’s question is about the difference between SPARQL and FedX federation.

GraphDB Users Ask: What Does The “Insufficient Free Heap Memory” Error Mean?

In this feature, we answer questions from our GraphDB users. Today’s question is about what the “Insufficient Free Heap memory” error means.

GraphDB Users Ask: How To Optimize My Inference?

In this feature, we answer questions from our GraphDB users. Today’s question is about how to optimize inference.

GraphDB Users Ask: Is RDF-Star The Best Choice For Reification?

In this feature, we answer questions from our GraphDB users. Today’s question is about whether RDF-star is the best choice for reification.

GraphDB Users Ask: Can GraphDB Infer Data Based on Values From a Virtualized Repository?

In this feature, we answer questions from our GraphDB users. Today’s question is about if GraphDB’s inference works with virtualized repositories.

GraphDB Users Ask: How Does SHACL Work on GraphDB?

In this feature, we answer questions from our GraphDB users. Today’s question is about how SHACL works on GraphDB.

GraphDB Users Ask: Does GraphDB Support ABAC?

In this feature, we answer questions from our GraphDB users. Today’s question is about if GraphDB supports ABAC.

GraphDB Users Ask: Why Do I Get Errors About GraphDB Being “Unable to Find Valid Certification Path to Requested Target”?

In this feature, we answer questions from our GraphDB users. Today’s question is about getting errors about GraphDB being “unable to find valid certification path to requested target”.

GraphDB Users Ask: How Can I Break Up My Data to Control Access To It?

In this feature on our blog, we answer questions from our GraphDB users. Today’s question is about GraphDB security and access control.

GraphDB Users Ask: Why does My Import Start Really Fast But Then Starts Losing Speed After a While?

In this feature on our blog, we answer questions from our GraphDB users. Today’s question is about GraphDB import speed.

GraphDB Users Ask: Can You Help Me Understand The Built-in GraphDB Security?

In this feature on our blog, we answer questions from our GraphDB users. Today’s question is about GraphDB security.

GraphDB Users Ask: How Many Repositories Can I Have in GraphDB and How Can I Unite the Disparate Data Between Them?

In this feature, we answer questions from our GraphDB users. Today’s question is about the number of repos in GraphDB and accessing the data.