mojira.dev
MC-245918

Update log4j to safe version

Hi there,

on the announcement page for Minecraft 1.18.1 it states

This release fixes a critical security issue for multiplayer servers

which I assume references the recent log4j vulnerabilities.

After upgrading to 1.18.1 I noticed that the vulnerable versions are still being shipped! In %APPDATA%/.minecraft/libraries/org/apache/logging/log4j there are the following files:

log4j-api/2.14.1/log4j-api-2.14.1.jar
log4j-core/2.14.1/log4j-core-2.14.1.jar
log4j-slf4j18-impl/2.14.1/log4j-slf4j18-impl-2.14.1.jar

I manually deleted them, restarted the launcher and game. The game automatically re-downloaded them again. I found that %APPDATA%/.minecraft/assets/log_configs/client-1.12.xml now contains a patched PatternLayout

<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %msg{nolookups}%n" />

But according to the log4j developers, this setting is NOT SUFFICIENT to mitigate the security problem. So please update log4j to a safe version in order to protect your users.

Attachments

Comments 13

If you believe that a security issue still exists, please provide a proof of concept in a private bug report.

The fact that the log4j2 version being outdated is not sufficient for showing that the exploit still affects Minecraft.

At this point we're not aware of any log4j2 exploit that could be used in conjunction with Minecraft.

Per Apache, you have to have log4j version 2.17. Anything lower is vulnerable.  Previous mitigations are being seen to be ineffective at this time.

 

Log4j – Apache Log4j Security Vulnerabilities 

DO NOT mark this as resolved, as the issue wasn't even understood by the moderator.

Here I post what in my opinion the developers should do to properly fix the vulnerability in all affected versions:

1. For versions 17w15a and later, bump the log4j version to 2.17.1.

2. For versions 13w39a to 17w14a, bump the log4j version to 2.17.1, add com.mojang.patchy as a library, and change log4j configuration version from 1.7 to 1.12.

I attached a sample of a fixed Minecraft 1.7.10 json in the issue, so that everyone can test it and see for themselves if it works.

And what exploit would be averted by making these changes? Please share a proof of concept

Tryashtar.  Why submit a POC, when news stories already showed the POC in action for Minecraft and how it was exploited? Or the fact that the Open source software creator / maintainer is saying that the critical issues are not addressed unless you are at a version of at least 2.17 (The issue resolved in 2.17.1 is important, but is not aC CVSS of 9 or higher like the others).

You risk the safety of your users by not patching this vulnerability.

3 more comments

The shipped version of log4j-core-2.14.1.jar may be patched.  But I get security alerts and our IT security will remove this file.

Not only is the shipped log4j version listed as a vulnerable version.
It contains org\apache\logging\log4j\core\lookup\JndiLookup.class.
If you fingerprint the jar-file, it has even been tampered with. (Oops. Sorry. I crisscrossed)
And the JAR-file still containes the vulnerability, (even if Minecraft may be blocking the exploits).

Lot's a reasons that a security scanner will identify the shipped jar file as a security risk.

I don't understand why we can't upgrade to a known not-vulnerable version og log4j.

Best regards : )

Hopefully this is actually resolved soon...Nessus flags this every time it runs against my (personal) MC server. I'd think that it'd be straightforward to follow Apache's guidance and move up to 2.17.1, as they say that every version older than that has issues.

https://logging.apache.org/log4j/2.x/

 

@tryashtar, any way to get this reopened?

I'll add as well – you can't just remove the .class file from the log4j jar, because it detects that you modified the jar, and re-extracts it >.<

Expected file libraries/org/apache/logging/log4j/log4j-core/2.14.1/log4j-core-2.14.1.jar to have hash ade7402a70667a727635d5c4c29495f4ff96f061f12539763f6f123973b465b0, but got dd6b13ef700b6efff3dbb268a3cd4592f7f2ed4617a6a86e5f4ec988bb500d05

Unpacking org/apache/logging/log4j/log4j-core/2.14.1/log4j-core-2.14.1.jar (libraries:org.apache.logging.log4j:log4j-core:2.14.1) to libraries/org/apache/logging/log4j/log4j-core/2.14.1/log4j-core-2.14.1.jar

 

My solution is to delete the jar file after every time I've played, to avoid being called up by the security next time they scan.

 

Not ideal, but works

Quorn McDuff

(Unassigned)

Unconfirmed

(Unassigned)

1.18.1

Retrieved