mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2024-11-21 03:10:58 +08:00
Always issue security warning
This commit is contained in:
parent
38013a9298
commit
49378061bf
@ -529,27 +529,22 @@ public final class LauncherHelper {
|
||||
}
|
||||
|
||||
// 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) {
|
||||
String xmlSha1 = Optional.ofNullable(version.getLogging().get(DownloadType.CLIENT))
|
||||
.flatMap(loggingInfo -> Optional.of(loggingInfo.getFile()))
|
||||
.flatMap(idDownloadInfo -> Optional.ofNullable(idDownloadInfo.getSha1()))
|
||||
.orElse("");
|
||||
if (gameVersion.compareTo(VersionNumber.asVersion("1.12")) < 0) {
|
||||
if (UNSAFE_CLIENT_1_7_XML_SHA1.contains(xmlSha1)) {
|
||||
Controllers.confirm(i18n("launch.advice.log4j_cve_2021_44228"), i18n("message.warning"), continueAction, null);
|
||||
suggested = true;
|
||||
}
|
||||
} else {
|
||||
if (UNSAFE_CLIENT_1_12_XML_SHA1.contains(xmlSha1)) {
|
||||
Controllers.confirm(i18n("launch.advice.log4j_cve_2021_44228"), i18n("message.warning"), continueAction, null);
|
||||
suggested = true;
|
||||
}
|
||||
if (gameVersion.compareTo(VersionNumber.asVersion("1.7")) >= 0 && gameVersion.compareTo(VersionNumber.asVersion("1.18")) <= 0) {
|
||||
String xmlSha1 = Optional.ofNullable(version.getLogging().get(DownloadType.CLIENT))
|
||||
.flatMap(loggingInfo -> Optional.of(loggingInfo.getFile()))
|
||||
.flatMap(idDownloadInfo -> Optional.ofNullable(idDownloadInfo.getSha1()))
|
||||
.orElse("");
|
||||
if (gameVersion.compareTo(VersionNumber.asVersion("1.12")) < 0) {
|
||||
if (UNSAFE_CLIENT_1_7_XML_SHA1.contains(xmlSha1)) {
|
||||
Controllers.confirm(i18n("launch.advice.log4j_cve_2021_44228"), i18n("message.warning"), continueAction, null);
|
||||
}
|
||||
} else {
|
||||
if (UNSAFE_CLIENT_1_12_XML_SHA1.contains(xmlSha1)) {
|
||||
Controllers.confirm(i18n("launch.advice.log4j_cve_2021_44228"), i18n("message.warning"), continueAction, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!suggested) {
|
||||
future.complete(javaVersion);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user