hotpatch-for-apache-log4j2
hotpatch-for-apache-log4j2 copied to clipboard
Log4j Disable Literal Pattern Converter
Although -DformatMsgNoLookups=true prevents lookups directly in the message, Format Lookups are possible when reading a property from the ThreadContext/MDC in the pattern for the message. On certain scenarios, this can cause a StackOverflow through recursive lookups as described on CVE-2021-45105.
This patch disables lookups in Message Pattern by patching LiteralPatternConverter.
The patch for LiteralPatternConverter is not enabled by default and can be enabled using the following parameters
patcherClassName=com.amazon.corretto.hotpatch.patch.impl.set.Log4j2PatchSetWithDisableLookups