Always issue security warning

This commit is contained in:
Glavo 2021-12-11 13:11:57 +08:00 committed by Yuhui Huang
parent 38013a9298
commit 49378061bf

View File

@ -529,7 +529,6 @@ public final class LauncherHelper {
} }
// CVE-2021-44228 Remote code injection in Log4j // CVE-2021-44228 Remote code injection in Log4j
if (!suggested) {
if (gameVersion.compareTo(VersionNumber.asVersion("1.7")) >= 0 && gameVersion.compareTo(VersionNumber.asVersion("1.18")) <= 0) { if (gameVersion.compareTo(VersionNumber.asVersion("1.7")) >= 0 && gameVersion.compareTo(VersionNumber.asVersion("1.18")) <= 0) {
String xmlSha1 = Optional.ofNullable(version.getLogging().get(DownloadType.CLIENT)) String xmlSha1 = Optional.ofNullable(version.getLogging().get(DownloadType.CLIENT))
.flatMap(loggingInfo -> Optional.of(loggingInfo.getFile())) .flatMap(loggingInfo -> Optional.of(loggingInfo.getFile()))
@ -538,17 +537,13 @@ public final class LauncherHelper {
if (gameVersion.compareTo(VersionNumber.asVersion("1.12")) < 0) { if (gameVersion.compareTo(VersionNumber.asVersion("1.12")) < 0) {
if (UNSAFE_CLIENT_1_7_XML_SHA1.contains(xmlSha1)) { if (UNSAFE_CLIENT_1_7_XML_SHA1.contains(xmlSha1)) {
Controllers.confirm(i18n("launch.advice.log4j_cve_2021_44228"), i18n("message.warning"), continueAction, null); Controllers.confirm(i18n("launch.advice.log4j_cve_2021_44228"), i18n("message.warning"), continueAction, null);
suggested = true;
} }
} else { } else {
if (UNSAFE_CLIENT_1_12_XML_SHA1.contains(xmlSha1)) { if (UNSAFE_CLIENT_1_12_XML_SHA1.contains(xmlSha1)) {
Controllers.confirm(i18n("launch.advice.log4j_cve_2021_44228"), i18n("message.warning"), continueAction, null); Controllers.confirm(i18n("launch.advice.log4j_cve_2021_44228"), i18n("message.warning"), continueAction, null);
suggested = true;
} }
} }
} }
}
if (!suggested) { if (!suggested) {
future.complete(javaVersion); future.complete(javaVersion);