Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2021-44228 PoC — Apache Log4j2 JNDI features do not protect against attacker controlled LDAP and other JNDI related endpoints

Source
Associated Vulnerability
Title:Apache Log4j2 JNDI features do not protect against attacker controlled LDAP and other JNDI related endpoints (CVE-2021-44228)
Description:Apache Log4j2 2.0-beta9 through 2.15.0 (excluding security releases 2.12.2, 2.12.3, and 2.3.1) 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. From log4j 2.15.0, this behavior has been disabled by default. From version 2.16.0 (along with 2.12.2, 2.12.3, and 2.3.1), this functionality has been completely removed. Note that this vulnerability is specific to log4j-core and does not affect log4net, log4cxx, or other Apache Logging Services projects.
Description
CVE-2021-44228 server-side fix for minecraft servers.
Readme
# mc-log4j-patcher

Replaces old (vulnerable - CVE-2021-44228) Log4j2 version with the latest one (2.15.0) that contains the JNDI RCE fix.\
Tested on Spigot 1.12.2, PaperSpigot 1.8.8, PaperSpigot 1.17.1

This is intended to fix servers that are currently unsupported, such as PaperSpigot 1.8.8\
Please check if your current server software has an official release fixing the vulnerability before using this tool.

Usage:\
`java -jar patcher.jar <old-server.jar> <fixed-server.jar>`

[Download patcher.jar](https://github.com/OopsieWoopsie/mc-log4j-patcher/raw/main/patcher.jar)

If you use PaperSpigot, then the "old-server.jar" file should be the one located at "cache/patched.jar" and not the paperclip.jar wrapper.\
After the process finishes, you need to replace your old server jar with the "fixed-server.jar" one.

### Example usage with PaperSpigot 1.17.1
```
server$ java -jar patcher.jar cache/patched_1.17.1.jar server.jar
Input file  : cache/patched_1.17.1.jar
Output file : server.jar
Processing original Jar file...
Adding nolookups to log4j2.xml ... Done
Adding Log4j2 2.15.0 (core+api+iostreams)... 
(You can likely ignore this) : duplicate entry: META-INF/MANIFEST.MF
(You can likely ignore this) : duplicate entry: META-INF/NOTICE
(You can likely ignore this) : duplicate entry: META-INF/maven/org.apache.logging.log4j/log4j-core/pom.xml
(You can likely ignore this) : duplicate entry: META-INF/services/javax.annotation.processing.Processor
(You can likely ignore this) : duplicate entry: META-INF/LICENSE
(You can likely ignore this) : duplicate entry: META-INF/DEPENDENCIES
(You can likely ignore this) : duplicate entry: META-INF/maven/org.apache.logging.log4j/log4j-core/pom.properties
(You can likely ignore this) : duplicate entry: META-INF/maven/org.apache.logging.log4j/log4j-api/pom.properties
(You can likely ignore this) : duplicate entry: META-INF/maven/org.apache.logging.log4j/log4j-api/pom.xml
Finished
```

And then to run the server:
```
server$ java -jar server.jar nogui
System Info: Java 16 (Eclipse OpenJ9 VM openj9-0.27.0) Host: Linux 5.4.0-81-generic (amd64)
Loading libraries, please wait...

...(server loading log)...
```
File Snapshot

[4.0K] /data/pocs/cfcbd2313e3139b2c1f4ab0cdab811f991313d9f ├── [ 34K] LICENSE ├── [1.8M] patcher.jar ├── [1.1K] pom.xml ├── [2.1K] README.md └── [4.0K] src └── [4.0K] main ├── [4.0K] java │   └── [4.0K] me │   └── [4.0K] sheidy │   └── [4.7K] Patcher.java └── [4.0K] resources └── [2.0M] log4j-2.15.0-all.jar 6 directories, 6 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →