- Overview
- Mitigation
- Identify Vulnerable Systems
- Update or Mitigate
- Environment Hardening
- Audit and Monitoring
- Incident Preparedness
- Additional Considerations
Overview
The Log4Shell vulnerability CVE-2021-44228 is critical in the Apache Log4j 2 library that allows remote code execution by logging a specially crafted request. Addressing this vulnerability requires a thorough approach. Here's a technical checklist to help you ensure that your systems are protected against the Log4Shell vulnerability:
Mitigation
Identify Vulnerable Systems
Log4j 2.x.# Manual approach
find / -name 'log4j-core*.jar'build.gradle for Gradle) for Log4j 2.x references.// For Maven:
mvn dependency:tree
// For Gradle:
gradle dependenciesLog4j 2.x libraries in your application servers, web servers, and other environments where Java applications are deployed.Update or Mitigate
2.17.1 or newer, as these versions contain fixes for the Log4Shell vulnerability and other subsequent vulnerabilities discovered in Log4j. Tools like Renovate, Dependabot, or Snyk can help automatically create pull requests to update dependencies.JndiLookup class from the classpath: zip -q -d path/to/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.classFor Log4j versions 2.10 to 2.14.1, set the system property log4j2.formatMsgNoLookups to true or the environment variable LOG4J_FORMAT_MSG_NO_LOOKUPS to true.
In cases where updating Log4j is not immediately feasible, use JVM options to enforce the removal of the vulnerable class:
-Dlog4j2.formatMsgNoLookups=true
-Dlog4j.configurationFile=/path/to/custom/log4j2.xmlEnvironment Hardening
LDAP/RMI requests to attacker-controlled servers.LDAP, RMI, and other protocols often exploited by Log4Shell.Audit and Monitoring
Tools like Elasticsearch, Logstash, and Kibana (ELK) or Splunk can be configured to alert on patterns indicative of exploitation attempts, such as unexpected external LDAP/RMI requests or the presence of ${jndi:ldap:// strings in logs.
Incident Preparedness
Additional Considerations
Completing this checklist can significantly reduce the risk of exploitation via the Log4Shell vulnerability in your environment. Remember, the threat landscape continually evolves, so staying informed about new vulnerabilities and patches is crucial.