An agent to hotpatch the log4j RCE from CVE-2021-44228.

Overview

Log4jHotPatch

This is a tool which injects a Java agent into a running JVM process. The agent will attempt to patch the lookup() method of all loaded org.apache.logging.log4j.core.lookup.JndiLookup instances to unconditionally return the string "Patched JndiLookup::lookup()". It is designed to address the CVE-2021-44228 remote code execution vulnerability in Log4j without restarting the Java process. This tool will also address CVE-2021-45046.

This has been currently only tested with JDK 8, 11, 15 and 17 on Linux!

Building

Gradle

To build on linux, mac and Windows subsystem for linux

./gradlew build

To build on Windows

.\gradlew.bat build

Depending on the platform you are building. This will generate build/libs/Log4jHotPatch.jar

Maven

To build using Maven use

mvn clean package

This will generate a target/Log4jHotPatch.jar.

Running

JDK 8

java -cp <java-home>/lib/tools.jar:Log4jHotPatch.jar Log4jHotPatch <java-pid>

JDK 11 and newer

java -jar Log4jHotPatch.jar <java-pid>

Running the static agent

Simply add the agent to your java command line as follows:

java -classpath <class-path> -javaagent:Log4jHotPatch.jar <main-class> <arguments>

Testing the agent

There are a set of tests that can be run outside Gradle or Maven.

build-tools/bin/run_tests.sh Log4jHotPatch.jar <JDK_ROOT>

Known issues

If you get an error like:

Exception in thread "main" com.sun.tools.attach.AttachNotSupportedException: The VM does not support the attach mechanism
	at jdk.attach/sun.tools.attach.HotSpotAttachProvider.testAttachable(HotSpotAttachProvider.java:153)
	at jdk.attach/sun.tools.attach.AttachProviderImpl.attachVirtualMachine(AttachProviderImpl.java:56)
	at jdk.attach/com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:207)
	at Log4jHotPatch.loadInstrumentationAgent(Log4jHotPatch.java:115)
	at Log4jHotPatch.main(Log4jHotPatch.java:139)

this means that your JVM is refusing any kind of help because it is running with -XX:+DisableAttachMechanism.

If you get an error like:

com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded
	at sun.tools.attach.LinuxVirtualMachine.<init>(LinuxVirtualMachine.java:106)
	at sun.tools.attach.LinuxAttachProvider.attachVirtualMachine(LinuxAttachProvider.java:63)
	at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:208)
	at Log4jHotPatch.loadInstrumentationAgent(Log4jHotPatch.java:182)
	at Log4jHotPatch.main(Log4jHotPatch.java:259)

this means you're running as a different user (including root) than the target JVM. JDK 8 can't handle patching as root user (and triggers a thread dump in the target JVM which is harmless). In JDK 11 patching a non-root process from a root process works just fine.

If you get an error like this in the target process:

Exception in thread "Attach Listener" java.lang.ExceptionInInitializerError
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
        at sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(InstrumentationImpl.java:411)
Caused by: java.security.AccessControlException: access denied ("java.util.PropertyPermission" "log4jFixerAgentVersion" "write")
        at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
        at java.security.AccessController.checkPermission(AccessController.java:886)
        at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
        at java.lang.System.setProperty(System.java:794)
        at Log4jHotPatch.<clinit>(Log4jHotPatch.java:66)

it means the target process has a security manager installed. Look for this command line option in the target process:

-Djava.security.policy=/local/apollo/.../apollo-security.policy

If you encounter this error, make sure you are using the latest version of the tool

Important: If you attempted to patch as the wrong user, you may need to delete .attach_pid<pid> files (found in /tmp and/or the CWD of the VM process) before trying again. These files need to have the right ownership for attach to succeed.

Comments
  • Unable to install the patch in MacOs

    Unable to install the patch in MacOs

    Environment:

    macOs Monterey 12.1 java -version openjdk version "11.0.9.1" 2020-11-04 LTS OpenJDK Runtime Environment Corretto-11.0.9.12.1 (build 11.0.9.1+12-LTS) OpenJDK 64-Bit Server VM Corretto-11.0.9.12.1 (build 11.0.9.1+12-LTS, mixed mode)

    I tried to run the below command : jar -cfm Log4jHotPatch.jar Manifest.mf *.class

    Got the error below:

    java.io.FileNotFoundException: Manifest.mf (No such file or directory) at java.base/java.io.FileInputStream.open0(Native Method) at java.base/java.io.FileInputStream.open(FileInputStream.java:219) at java.base/java.io.FileInputStream.(FileInputStream.java:157) at java.base/java.io.FileInputStream.(FileInputStream.java:112) at jdk.jartool/sun.tools.jar.Main.run(Main.java:267) at jdk.jartool/sun.tools.jar.Main.main(Main.java:1681)

    Am i missing something.

    opened by pavan2004it 14
  • JDK 8 - Error: Could not find or load main class <PID>

    JDK 8 - Error: Could not find or load main class

    When trying to run

    java -cp <java-home>/lib/tools.jar:Log4jHotPatch.jar <java-pid>
    

    with JDK 8, I only get the message

    Error: Could not find or load main class <PID>
    

    what could i be doing wrong?

    opened by dunkla 10
  • We are seeing logging to to stdout which affects parsing of our outputs

    We are seeing logging to to stdout which affects parsing of our outputs

    We are seeing logging to to stdout which affects parsing of our outputs.

    I have tried:

       <sysproperty key="log4jFixerVerbose" value="false" escape="false"/>
    

    However, we are still getting the log messages like:

    Loading Java Agent version 1 (using ASM6).
    Patching class org.apache.logging.log4j.core.lookup.JndiLookup (com.amazon.cloud9.launcher.BootstrapClassLoader@29444d75)
    Transforming org/apache/logging/log4j/core/lookup/JndiLookup (com.amazon.cloud9.launcher.BootstrapClassLoader@29444d75)
    

    Any idea why the sysproperty might be ignored? Thanks!

    opened by georgezhe 7
  • Log to stderr instead of stdout

    Log to stderr instead of stdout

    Ensures any log messages from the hot patch are separate from any user program output that may be being used elsewhere.

    By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

    opened by stewartsmith 6
  • Add Maven project support

    Add Maven project support

    Issue #, if available:

    Description of changes:

    This change allows this project to be built using Maven. Project build/config based on the build.gradle file.

    Tested using

    build-tools/bin/run_tests.sh target/Log4jHotPatch.jar ~/amazon-corretto-8.282.08.1-linux-x64
    build-tools/bin/run_tests.sh target/Log4jHotPatch.jar ~/amazon-corretto-17.0.1.12.1-linux-x64
    

    By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

    opened by dagnir 6
  • Avoid security manager

    Avoid security manager

    This patch modifies AccessController to temporarily ignore security manager checks which can fail in very restricted environments, as when setting properties. It also avoids reflection.

    opened by raphw 5
  • Make it possible to version, upgrade and undo patches in the agent.

    Make it possible to version, upgrade and undo patches in the agent.

    This is a POC and work in progress! I haven't updated the file layout so the build and tests didn't had to be changed as well. All the tests except the security manager test pass (and I hope we can make the latter pass as well).

    In general, this PR should be merged with the file layout and refactoring changes of #39.

    The ideas behind this change is as follows:

    • Divide the agent into a bare minimum agent part, a "payload" part (i.e. a "patcher" or "transformer") and a driver which injects the agent together with a "patcher" into the target VM.
    • The agent uses a custom class loader to load the payload (i.e. the transformers) which implements the Patcher interface.
    • The agent manages the transformers through the general Patcher interface methods install(),uninstall() and getVersion()
    • calling install() on a Patcher will register all its transformers and retransform the affected classes in the dynamic use case
    • calling uninstall()on a Patcher will unregister its transformers and retransform the previously transformed classes back to their initial state.

    The current change contains three patchers, EmptyPatcher, PatcherV1 and PatcherV2 which all implement Patcher. EmptyPatcher is special in that it contains no functionality and has version number "0". PatcherV1 and PatcherV2 both implement the current Log4j patch with version numbers "1" and "2" respectively.

    The main driver (i.e. Log4jHotPatch.main()) has a hard-coded version of the patcher it will deploy. This is currently PatcherV1 for testing reason. In reality this should be the latest patcher (i.e. the one with the highest version number). The driver attaches the target JVM and checks for the version of the transformer it already has. If there's no transfomer installed or if the transformer in the target JVM is smaller than the current transformer in the driver, the driver will deploy its transformer into the target. In the target this will trigger uninstallation of the old transformer and installation of the new one.

    EmptyPatcher (i.e. version "0") is treated special in the driver. It can be used to overwrite any installed transformer in the target, effectively undoing all previous transformations. This can be used to "downgrade" the transformer e.g. by going from "2" to "0" to "1".

    Apart from deploying the "default" transformer, the driver can be configured to deploy any available transformer by specifying its name with the patcherClassName property on the command line (e.g. -D'patcherClassName=Log4jHotPatch$PatcherV1').

    Because all references to the custom class loaders and transformer are deleted in the agent once a new transformer will be installed, the old ones can be collected and unloaded by the JVM.

    opened by simonis 4
  • Split Injector, Agent and Patch into different classes

    Split Injector, Agent and Patch into different classes

    This change is split in three commits to help with the reviewing process, but should be squashed before merging

    This change splits the code for the project into multiple java files, decoupling them:

    • We have one class that represents the agent (keeping the premain and agentmain methods from the original patch
    • One class to start the jar and attach to the vm (keeping the main method and the methods it calls
    • One class that represents the actual bytecode transformation for the patch as Log4j2NoJndiLookup
    • Some other utility classes

    With this change, it will become less dangerous to import other patches that we might want the tool to support.

    opened by alvdavi 4
  • error installing in ubuntu 20.04

    error installing in ubuntu 20.04

    The command gives me the following error:

    # ./gradlew build --warning-mode all
    
    > Configure project :
    The AbstractArchiveTask.version property has been deprecated. This is scheduled to be removed in Gradle 8.0. Please use the archiveVersion property instead. See https://docs.gradle.org/7.1/dsl/org.gradle.api.tasks.bundling.AbstractArchiveTask.html#org.gradle.api.tasks.bundling.AbstractArchiveTask:version for more details.
            at build_34dfj8owb22lztkrt6bemzzq5$_run_closure2.doCall(/root/hotpatch-for-apache-log4j2/build.gradle:17)
            (Run with --stacktrace to get the full stack trace of this deprecation warning.)
    The AbstractArchiveTask.archiveName property has been deprecated. This is scheduled to be removed in Gradle 8.0. Please use the archiveFileName property instead. See https://docs.gradle.org/7.1/dsl/org.gradle.api.tasks.bundling.AbstractArchiveTask.html#org.gradle.api.tasks.bundling.AbstractArchiveTask:archiveName for more details.
            at build_34dfj8owb22lztkrt6bemzzq5$_run_closure3.doCall(/root/hotpatch-for-apache-log4j2/build.gradle:34)
            (Run with --stacktrace to get the full stack trace of this deprecation warning.)
    
    FAILURE: Build failed with an exception.
    
    * Where:
    Build file '/root/hotpatch-for-apache-log4j2/build.gradle' line: 46
    
    * What went wrong:
    A problem occurred evaluating root project 'hotpatch-for-apache-log4j2'.
    > java.lang.NullPointerException (no error message)
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    
    * Get more help at https://help.gradle.org
    
    BUILD FAILED in 1s
    

    Should I add debug output as well?

    opened by cortex3 4
  • Apache Oozie job failing with the hotpatch

    Apache Oozie job failing with the hotpatch

    Apache Oozie job intermittently fails after applying the hotpatch. This is because Oozie will list and the print the file and directory name in the current directory. On the other hand, the hotpatch creates attach_pid file in the current directory to attach the JVM and then delete it. When the attach_pid file is deleted between the listing and the printing, the Oozie job fails by NoSuchFileException. The below is the stacktrace:

    java.nio.file.NoSuchFileException: ./.attach_pid1517
        at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
        at sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
        at sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:144)
        at sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:99)
        at java.nio.file.Files.readAttributes(Files.java:1737)
        at java.nio.file.FileTreeWalker.getAttributes(FileTreeWalker.java:225)
        at java.nio.file.FileTreeWalker.visit(FileTreeWalker.java:276)
        at java.nio.file.FileTreeWalker.next(FileTreeWalker.java:372)
        at java.nio.file.Files.walkFileTree(Files.java:2706)
        at org.apache.oozie.action.hadoop.LocalFsOperations.printContentsOfDir(LocalFsOperations.java:59)
        at org.apache.oozie.action.hadoop.LauncherAM.printDebugInfo(LauncherAM.java:293)
        at org.apache.oozie.action.hadoop.LauncherAM.access$100(LauncherAM.java:55)
        at org.apache.oozie.action.hadoop.LauncherAM$2.run(LauncherAM.java:221)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:422)
        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1844)
        at org.apache.oozie.action.hadoop.LauncherAM.run(LauncherAM.java:217)
        at org.apache.oozie.action.hadoop.LauncherAM$1.run(LauncherAM.java:153)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:422)
        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1844)
        at org.apache.oozie.action.hadoop.LauncherAM.main(LauncherAM.java:141)
    

    The mitigation is to disable the hotpatch on the Oozie server.

    I plan to provide a fix to Oozie to retry the directory listing, however, it is worth creating the issue here for searchability. Thanks.

    opened by aajisaka 3
  • Hotpatch installation reports error Failed to get D-Bus connection: Operation not permitted

    Hotpatch installation reports error Failed to get D-Bus connection: Operation not permitted

    Steps to reproduce :

    If you try to install any one of these procps-ng/net-tools/iputils before installing corretto, then log4j hotpatch will report following error while installation, however installation completed. Dockerfile :

    FROM amazonlinux:2 
    RUN yum update -y
    RUN yum install -y procps-ng net-tools iputils
    RUN amazon-linux-extras enable corretto8
    RUN yum install -y java-1.8.0-amazon-corretto-devel
    
    $ docker build -t log4j .
    

    Installation of log4j-cve-2021-44228-hotpatch-1.1-12.amzn2.noarch reports following error :

    Failed to get D-Bus connection: Operation not permitted
    Created symlink /etc/systemd/system/multi-user.target.wants/log4j-cve-2021-44228-hotpatch.service, pointing to /usr/lib/systemd/system/log4j-cve-2021-44228-hotpatch.service.
    Failed to get D-Bus connection: Operation not permitted
    warning: %post(log4j-cve-2021-44228-hotpatch-1.1-12.amzn2.noarch) scriptlet failed, exit status 1
    Non-fatal POSTIN scriptlet failure in rpm package log4j-cve-2021-44228-hotpatch-1.1-12.amzn2.noarch
    

    As a workaround, you can try installing procps-ng/net-tools/iputils these after corretto.

    opened by git4example 3
  • /tmp mount points in hot patch

    /tmp mount points in hot patch

    The hot patch created a lot of /tmp mount points. Since my customer collects metrics on mount points, these /tmp mount points cost customer a lot on these unwanted metrics. Could these mount points be disabled ?

    opened by xge8446 0
  • Cannot attach `Log4jHotPatch` agent to official releases of Jenkins

    Cannot attach `Log4jHotPatch` agent to official releases of Jenkins

    Note: All instructions here assume Java 11 (OpenJDK), but I was also able to reproduce the issue with Java 8 (OpenJDK).

    Steps to reproduce

    Expected results

    Note: These are the actual results with a local (non-official) build of Jenkins:

    The Log4jHotPatch agent is attached successfully.

    Actual results

    The Log4jHotPatch agent cannot be attached:

    com.sun.tools.attach.AgentInitializationException: Agent JAR loaded but agent failed to initialize
    	at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.loadAgent(HotSpotVirtualMachine.java:165)
    	at Log4jHotPatch.loadInstrumentationAgent(Log4jHotPatch.java:228)
    	at Log4jHotPatch.main(Log4jHotPatch.java:301)
    Error: couldn't loaded the agent into JVM process 546677
    

    The Jenkins logs show:

    Exception in thread "Attach Listener" java.lang.SecurityException: class "Log4jHotPatch"'s signer information does not match signer information of other classes in the same package
    	at java.base/java.lang.ClassLoader.checkCerts(ClassLoader.java:1151)
    	at java.base/java.lang.ClassLoader.preDefineClass(ClassLoader.java:906)
    	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1015)
    	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
    	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:800)
    	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698)
    	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
    	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
    	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
    	at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:431)
    	at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(InstrumentationImpl.java:535)
    Agent failed to start!
    

    Evaluation

    Stepping through the problematic frames in the debugger, I do not think Jenkins is at fault here. Jenkins contains some classes in the unnamed package namespace:

    $ jar tf jenkins.war
    […]
    ColorFormatter.class
    JNLPMain.class
    LogFileOutputStream$1.class
    LogFileOutputStream.class
    Main$FileAndDescription.class
    Main.class
    MainDialog.class
    […]
    META-INF/JENKINS.RSA
    META-INF/JENKINS.SF
    META-INF/MANIFEST.MF
    […]
    $
    

    Note that META-INF/JENKINS.RSA and META-INF/JENKINS.SF are only present in our signed official releases; a local build will not contain these. The presence of these classes and signatures means that the system class loader associates the signatures with the unnamed package namespace. Then, when Log4jHotPatch attempts to load a class into the same unnamed package namespace without a signature, class loading fails.

    I do not think Log4jHotPatch should make any assumptions about whether or not it is free to load unsigned classes into the unnamed package namespace. Perhaps Log4jHotPatch should use its own package namespace instead.

    opened by basil 4
  • No protection from combined attack with CVE-2021-45105

    No protection from combined attack with CVE-2021-45105

    With CVE-2021-45105 a malicious user can cause a DoS which in most scenarios will lead to JVM restart.

    After restart there's a time window when an attack against CVE-2021-45046 or CVE-2021-44228 could be launched before the agent has attached to the JVM process.

    Would it be possible to extend this solution to cover this scenario as well?

    opened by tookko 0
  • Log4j Disable Literal Pattern Converter

    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
    
    opened by cliveverghese 0
  • java.io.FileNotFoundException: /tmp/agentXXXXXX.jar issue at tomcat startup avoiding the webapp to start

    java.io.FileNotFoundException: /tmp/agentXXXXXX.jar issue at tomcat startup avoiding the webapp to start

    Hi, The patch has been deployed in AL1 on one of our server via "yum update --security", and we had a problem with it. We have the following error in the tomcat log avoiding any web applications to start on this server :

    java.io.FileNotFoundException: /tmp/agent693101429317028124.jar (Aucun fichier ou dossier de ce type) at java.util.zip.ZipFile.open(Native Method) at java.util.zip.ZipFile.(ZipFile.java:228) at java.util.zip.ZipFile.(ZipFile.java:157) at java.util.jar.JarFile.(JarFile.java:169) at java.util.jar.JarFile.(JarFile.java:106) at sun.net.www.protocol.jar.URLJarFile.(URLJarFile.java:93) at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:69) at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:99) at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:122) at sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:89) at org.apache.tomcat.util.scan.FileUrlJar.(FileUrlJar.java:48) at org.apache.tomcat.util.scan.JarFactory.newInstance(JarFactory.java:34) at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1957) at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1932) at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1917) at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1322) at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:388) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5566) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1017) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:993) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1127) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:2021) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

    In fact, this server has a specifiticy : there are 20 concurrent JVM / Tomcat instances running and launched via chkconfig services... I'm not sure but this could be the root cause of the pb... We applied the "sudo touch /etc/log4j-cve-2021-44228-hotpatch.kill" to deactivate the HotPatch, and it worked. So it confirms that the issue is due to the Log4j HotPatch. I think you should publish a fix for this because I assume we won't be the only impacted customers.

    A precision : we use amazon-corretto-8.302.08.1-linux-x64 under AL1

    Best Regards.

    opened by richardthibault 84
Owner
null
CVE-2021-44228 - Apache log4j RCE quick test

Build ./build.sh Start log4j RCE Server ./start-log4j-rce-server.sh Test Run java -cp log4j-rce-1.0-SNAPSHOT-all.jar log4j Check if you get logs in ha

Jeffrey Li 3 Feb 1, 2022
Log4j-RCE (CVE-2021-44228) Proof of Concept with additional information

Log4J-RCE-Proof-Of-Concept (CVE-2021-44228) This is a proof of concept of the log4j rce. Here are some links for the CVE-2021-44228: https://www.lunas

Johannes Jäger 181 Dec 2, 2022
Apache Log4j2 CVE-2021-44228 RCE Demo with RMI and LDAP

CVE-2021-44228-Demo 利用 CVE-2021-44228,通过 RMI 和 LDAP 两种方式远程注入代码的示例。 Exploit class from RMI Server loaded Hello, ${jndi:rmi://127.0.0.1:1099/exploit} Ex

Zhuang Ma 2 Dec 14, 2021
Small example repo for looking into log4j CVE-2021-44228

log4j CVE-2021-44228 Lame useless repo to look into log4j CVE-2021-44228. Setup The repository contains a .idea/ folder which is a IntelliJ IDEA proje

null 65 Dec 13, 2022
Scan and patch tool for CVE-2021-44228 and related log4j concerns.

A Log4J2 CVE-2021-44228 Vulnerability Scanner and Patcher Links to download the latest version: Linux x64 with glibc2.17+ (RHEL7+) Windows & all other

SAS Software 33 Jun 1, 2022
A singular file to protect as many Minecraft servers and clients as possible from the Log4j exploit (CVE-2021-44228).

MC-Log4J-Patcher The goal of this project is to provide Minecraft players, and server owners, peace of mind in regards to the recently discovered Log4

Koupa Taylor 4 Jan 4, 2022
Log4J CVE-2021-44228 Minecraft PoC

CVE-2021-44228 in Minecraft Java 16 Paper server build #397 Minecraft 1.17.1 Exploitation In Java 16 only deserialization attacks work by default usin

myxl 5 Feb 15, 2022
Log4j CVE-2021-44228 examples: Remote Code Execution (through LDAP, RMI, ...), Forced DNS queries, ...

Log4j CVE-2021-44228 and CVE-2021-45046 Requisites Use a vulnerable JDK, for instance JDK 1.8.0_181 Usage Malicious server The malicious server deploy

Manuel Álvarez Álvarez 5 Feb 7, 2022
Some tools to help mitigating Apache Log4j 2 CVE-2021-44228

JndiLookup Some tool to help analyzing Apache Log4j 2 CVE-2021-44228 This tool uses the "lookup" feature from log4j-2 to test against the JNDI vulnera

Daniel Fages 3 Dec 18, 2021
This project will help to test the Log4j CVE-2021-44228 vulnerability.

Log4j-JNDIServer This project will help to test the Log4j CVE-2021-44228/CVE-2021-45046 vulnerabilities. Installation and Building Load the project on

Immunity, Inc 9 Jun 30, 2022
Spring Boot Log4j - CVE-2021-44228 Docker Lab

Spring Boot Log4j - CVE-2021-44228 The Log4Shell vulnerability (CVE-2021-44228) ultimately is a quite simple JNDI Injection flaw, but in a really real

Tri Wanda Septian 19 Jun 10, 2022
CVE-2021-2109 && Weblogic Server RCE via JNDI

Description Vulnerability in the Oracle WebLogic Server product of Oracle Fusion Middleware (component: Console). Supported versions that are affected

Al1ex 29 Nov 21, 2022
Apache/Alibaba Dubbo <= 2.7.3 PoC Code for CVE-2021-25641 RCE via Deserialization of Untrusted Data; Affects Versions <= 2.7.6 With Different Gadgets

The 0xDABB of Doom - CVE-2021-25641-Proof-of-Concept Apache/Alibaba Dubbo <= 2.7.3 PoC Code for CVE-2021-25641 RCE via Deserialization of Untrusted Da

Dor Tumarkin 51 Apr 24, 2022
log4j2 Log4Shell CVE-2021-44228 proof of concept

Log4Shell CVE-2021-44228 proof of concept Requirement Java (JDK/JRE) 8 or later version curl exploitable Simple spring boot application that serves a

Seshu Pasam 2 Dec 21, 2021
An evil RMI server that can launch an arbitrary command. May be useful for CVE-2021-44228

evil-rmi-server An evil RMI server that can launch an arbitrary command. May be useful for CVE-2021-44228 in a local privesc scenario Build ./gradlew

Adam Bertrand 12 Nov 9, 2022
Test case to check if the Log4Shell/CVE-2021-44228 hotfix will raise any unexpected exceptions

Log4Shell Hotfix Side Effect Test Case I wanted to know if any ClassNotFoundException or similar unexpected exception is raised when one applies the C

Malte S. Stretz 3 Nov 9, 2022
A short demo of CVE-2021-44228

sample-ldap-exploit A short demo of CVE-2021-44228 Build $ mvn clean verify Run Attacker $ java \ -cp 'attacker/target/sample-attacker.jar:attacker

Philip Oswald 6 Oct 19, 2022
Spring Boot web application vulnerable to CVE-2021-44228, nicknamed Log4Shell.

Log4Shell sample vulnerable application (CVE-2021-44228) This repository contains a Spring Boot web application vulnerable to CVE-2021-44228, nickname

Christophe Tafani-Dereeper 1k Jan 5, 2023
Vulnerability CVE-2021-44228 checker

CVE-2021-44228 checker This is the repository for checking for vulnerability CVE-2021-44228. This is a PoC that only displays strings without any exte

Yasuhiro Yamada 36 Nov 9, 2022