diff --git a/dongtai-agent/pom.xml b/dongtai-agent/pom.xml index 7fe9753c6..5e4576c7a 100755 --- a/dongtai-agent/pom.xml +++ b/dongtai-agent/pom.xml @@ -194,4 +194,3 @@ - diff --git a/dongtai-core/src/main/java/io/dongtai/iast/core/AgentEngine.java b/dongtai-core/src/main/java/io/dongtai/iast/core/AgentEngine.java index 9ad089d2d..457675104 100644 --- a/dongtai-core/src/main/java/io/dongtai/iast/core/AgentEngine.java +++ b/dongtai-core/src/main/java/io/dongtai/iast/core/AgentEngine.java @@ -5,6 +5,8 @@ import io.dongtai.iast.common.state.AgentState; import io.dongtai.iast.common.state.State; import io.dongtai.iast.core.handler.hookpoint.models.policy.PolicyManager; +import io.dongtai.iast.core.handler.hookpoint.vulscan.dynamic.FastjsonCheck; +import io.dongtai.iast.core.handler.hookpoint.vulscan.dynamic.QLExpressCheck; import io.dongtai.iast.core.init.IEngine; import io.dongtai.iast.core.init.impl.ConfigEngine; import io.dongtai.iast.core.init.impl.TransformEngine; @@ -92,6 +94,10 @@ public static void stop() { public static void destroy(String mode, String propertiesFilePath, Instrumentation inst) { try { DongTaiLog.info("Uninstall engine"); + // 卸载对FastJson和QLExpress的调用 + FastjsonCheck.clearJsonClassLoader(); + FastjsonCheck.clearParseConfigClassLoader(); + QLExpressCheck.clearQLClassLoader(); AgentEngine agentEngine = AgentEngine.getInstance(); assert agentEngine != null; agentEngine.destroy(); diff --git a/dongtai-core/src/main/java/io/dongtai/iast/core/handler/hookpoint/vulscan/dynamic/FastjsonCheck.java b/dongtai-core/src/main/java/io/dongtai/iast/core/handler/hookpoint/vulscan/dynamic/FastjsonCheck.java index 31229db69..f99701305 100644 --- a/dongtai-core/src/main/java/io/dongtai/iast/core/handler/hookpoint/vulscan/dynamic/FastjsonCheck.java +++ b/dongtai-core/src/main/java/io/dongtai/iast/core/handler/hookpoint/vulscan/dynamic/FastjsonCheck.java @@ -83,4 +83,12 @@ public static void setJsonClassLoader(ClassLoader jsonClassLoader) { public static void setParseConfigClassLoader(ClassLoader parseConfigClassLoader) { PARSE_CONFIG_CLASS_LOADER = parseConfigClassLoader; } + + public static void clearJsonClassLoader(){ + JSON_CLASS_LOADER = null; + } + + public static void clearParseConfigClassLoader(){ + PARSE_CONFIG_CLASS_LOADER = null; + } } diff --git a/dongtai-core/src/main/java/io/dongtai/iast/core/handler/hookpoint/vulscan/dynamic/QLExpressCheck.java b/dongtai-core/src/main/java/io/dongtai/iast/core/handler/hookpoint/vulscan/dynamic/QLExpressCheck.java index c39027150..8bc1d3b6a 100644 --- a/dongtai-core/src/main/java/io/dongtai/iast/core/handler/hookpoint/vulscan/dynamic/QLExpressCheck.java +++ b/dongtai-core/src/main/java/io/dongtai/iast/core/handler/hookpoint/vulscan/dynamic/QLExpressCheck.java @@ -82,4 +82,8 @@ public boolean isSafe(MethodEvent event, SinkNode sinkNode){ public static void setQLClassLoader(ClassLoader qlClassLoader) { QL_CLASS_LOADER = qlClassLoader; } + + public static void clearQLClassLoader(){ + QL_CLASS_LOADER = null; + } } \ No newline at end of file