From b7ac0504f324f8f39559e9790899fbf76f36a55c Mon Sep 17 00:00:00 2001 From: "rick.parker" Date: Thu, 6 Apr 2023 14:55:25 +0100 Subject: [PATCH] Fix netty-codec-http, and make classes that are not present less intrusive. --- .../src/main/java/net/gredler/aegis4j/Patcher.java | 11 +++++++---- tools/cliutils/src/main/resources/mods.properties | 4 +++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/tools/aegis4j/src/main/java/net/gredler/aegis4j/Patcher.java b/tools/aegis4j/src/main/java/net/gredler/aegis4j/Patcher.java index b12fd05108..84227d9fbb 100644 --- a/tools/aegis4j/src/main/java/net/gredler/aegis4j/Patcher.java +++ b/tools/aegis4j/src/main/java/net/gredler/aegis4j/Patcher.java @@ -49,7 +49,7 @@ public final class Patcher implements ClassFileTransformer { * @param instr the instrumentation instance to add a new patcher to * @param block the features to block */ - public static void start(Instrumentation instr, Set block, Properties props) { + public static void start(Instrumentation instr, Set block, Properties props) throws IOException { System.out.println("Aegis4j patching starting"); if (patcher != null) instr.removeTransformer(patcher); patcher = new Patcher(block, props); @@ -57,11 +57,14 @@ public final class Patcher implements ClassFileTransformer { for (String className : patcher.modifications.keySet()) { try { - System.out.println("Aegis4j patching " + className + "..."); + System.out.print("Aegis4j patching " + className + "..."); Class clazz = Class.forName(className); instr.retransformClasses(clazz); - } catch (ClassNotFoundException | UnmodifiableClassException e) { - e.printStackTrace(); + System.out.println(); + } catch (ClassNotFoundException e) { + System.out.println("not present."); + } catch (UnmodifiableClassException e) { + throw new IOException("Problems transforming class", e); } } diff --git a/tools/cliutils/src/main/resources/mods.properties b/tools/cliutils/src/main/resources/mods.properties index 76ff3d11a3..4738c9be03 100644 --- a/tools/cliutils/src/main/resources/mods.properties +++ b/tools/cliutils/src/main/resources/mods.properties @@ -60,4 +60,6 @@ SNAKEYAML.org.yaml.snakeyaml.constructor.Constructor.Constructor=throw new java. KOTLIN.kotlin.io.FilesKt__UtilsKt.createTempDir=throw new java.lang.RuntimeException("Kotlin createTempDir blocked by aegis4j"); KOTLIN.kotlin.io.FilesKt__UtilsKt.createTempFile=throw new java.lang.RuntimeException("Kotlin createTempFile blocked by aegis4j"); # CVE-2020-8908 -GUAVA.com.google.common.io.Files.createTempDir=throw new java.lang.RuntimeException("Guava createTempDir blocked by aegis4j"); \ No newline at end of file +GUAVA.com.google.common.io.Files.createTempDir=throw new java.lang.RuntimeException("Guava createTempDir blocked by aegis4j"); +# CVE-2019-16869 - HttpObjectDecoder was called HttpMessageDecoder back then +NETTYHTTP.org.jboss.netty.handler.codec.http.HttpMessageDecoder.HttpMessageDecoder=throw new java.lang.RuntimeException("netty-codec-http HttpMessageDecoder blocked by aegis4j");