Skip to content

Commit d2a18ae

Browse files
authored
optimize: optimize fury deserialization (#7498)
1 parent db73418 commit d2a18ae

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

changes/en-us/2.x.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Add changes here for all PR submitted to the 2.x branch.
3131
- [[#7356](https://github.com/apache/incubator-seata/pull/7356)] fix codecov bug
3232
- [[#7370](https://github.com/apache/incubator-seata/pull/7370)] fix ISSUE_TEMPLATE not work
3333
- [[#7397](https://github.com/apache/incubator-seata/pull/7397)] Resolve NullPointer and port binding errors
34+
- [[#7498](https://github.com/apache/incubator-seata/pull/7498)] fix the class name whitelist check issue in fury deserialization
3435

3536

3637
### optimize:
@@ -138,6 +139,7 @@ Thanks to these contributors for their code commits. Please report an unintended
138139
- [jsbxyyx](https://github.com/jsbxyyx)
139140
- [simzyoo](https://github.com/simzyoo)
140141
- [Dltmd202](https://github.com/Dltmd202)
142+
- [GoodBoyCoder](https://github.com/GoodBoyCoder)
141143

142144

143145

changes/zh-cn/2.x.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
- [[#7356](https://github.com/apache/incubator-seata/pull/7356)] 修复 codecov 错误
3131
- [[#7370](https://github.com/apache/incubator-seata/pull/7370)] 修复 ISSUE_TEMPLATE 不可用
3232
- [[#7397](https://github.com/apache/incubator-seata/pull/7397)] 解决空指针和端口绑定错误
33+
- [[#7498](https://github.com/apache/incubator-seata/pull/7498)] 修复fury反序列化的类名白名单检查问题
3334

3435

3536
### optimize:
@@ -138,6 +139,7 @@
138139
- [YvCeung](https://github.com/YvCeung)
139140
- [jsbxyyx](https://github.com/jsbxyyx)
140141
- [simzyoo](https://github.com/simzyoo)
142+
- [GoodBoyCoder](https://github.com/GoodBoyCoder)
141143

142144

143145
同时,我们收到了社区反馈的很多有价值的issue和建议,非常感谢大家。

serializer/seata-serializer-fury/src/main/java/org/apache/seata/serializer/fury/FurySerializerFactory.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import org.apache.fury.ThreadSafeFury;
2222
import org.apache.fury.config.CompatibleMode;
2323
import org.apache.fury.config.Language;
24+
import org.apache.fury.resolver.AllowListChecker;
2425
import org.apache.seata.core.serializer.SerializerSecurityRegistry;
2526

2627
public class FurySerializerFactory {
@@ -41,9 +42,9 @@ public class FurySerializerFactory {
4142
.build();
4243

4344
// register allow class
44-
f.getClassResolver()
45-
.setClassChecker((classResolver, className) ->
46-
SerializerSecurityRegistry.getAllowClassPattern().contains(className));
45+
AllowListChecker checker = new AllowListChecker(AllowListChecker.CheckLevel.STRICT);
46+
f.getClassResolver().setClassChecker(checker);
47+
checker.allowClasses(SerializerSecurityRegistry.getAllowClassPattern());
4748
return f;
4849
});
4950

0 commit comments

Comments
 (0)