diff --git a/pom.xml b/pom.xml
index 2387b23..0792438 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,7 +33,7 @@
0.9.16
5.4.3
3.3.4
- 0.13.0
+ 1.3.0
1.5.7-6
diff --git a/snail-job-common/snail-job-common-core/src/main/java/com/aizuda/snailjob/common/core/util/ForyUtil.java b/snail-job-common/snail-job-common-core/src/main/java/com/aizuda/snailjob/common/core/util/ForyUtil.java
index a0bfae2..e8128eb 100644
--- a/snail-job-common/snail-job-common-core/src/main/java/com/aizuda/snailjob/common/core/util/ForyUtil.java
+++ b/snail-job-common/snail-job-common-core/src/main/java/com/aizuda/snailjob/common/core/util/ForyUtil.java
@@ -11,6 +11,7 @@ import org.apache.fory.config.CompatibleMode;
import org.apache.fory.config.Language;
import org.apache.fory.pool.ThreadPoolFory;
import org.apache.fory.resolver.AllowListChecker;
+import org.apache.fory.resolver.ClassResolver;
import java.io.BufferedReader;
import java.io.IOException;
@@ -20,7 +21,6 @@ import java.util.Base64;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;
-import java.util.concurrent.TimeUnit;
public class ForyUtil {
/**
@@ -38,20 +38,20 @@ public class ForyUtil {
Set disableClasses = getDisallowClasses();
checker.disallowClasses(disableClasses);
- SERIALIZER = new ThreadPoolFory(classLoader -> {
- Fory f = Fory.builder()
- .withLanguage(Language.JAVA)
- .requireClassRegistration(false)
- .withCompatibleMode(CompatibleMode.COMPATIBLE)
- .withClassLoader(classLoader)
- .build();
- f.getClassResolver().setTypeChecker(checker);
- checker.addListener(f.getClassResolver());
- return f;
- }, Runtime.getRuntime().availableProcessors(),
- Runtime.getRuntime().availableProcessors() * 2,
- 30,
- TimeUnit.MINUTES);
+ // fory 1.x:ThreadPoolFory 改为固定池,TypeChecker 在 Builder 上安装(CVE-2026-50076,需 >= 1.1.0)
+ int poolSize = Math.max(1, Runtime.getRuntime().availableProcessors() * 2);
+ ThreadPoolFory pool = (ThreadPoolFory) Fory.builder()
+ .withLanguage(Language.JAVA)
+ .requireClassRegistration(false)
+ .withCompatibleMode(CompatibleMode.COMPATIBLE)
+ .withTypeChecker(checker)
+ .buildThreadSafeForyPool(poolSize);
+ pool.registerCallback(f -> {
+ if (f.getTypeResolver() instanceof ClassResolver classResolver) {
+ checker.addListener(classResolver);
+ }
+ });
+ SERIALIZER = pool;
}
private static Set getDisallowClasses() {