We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jep290安全策略:全进程反序列化原则上使用白名单优先的设计模式,只有允许的类才能被反序列化,其它一律被阻止。 // 能被反序列化的流的限制 maxdepth=value // 单次反序列化堆栈最大深度 maxrefs=value // 单次反序列化类的内部引用的最大数目 maxbytes=value // 单次反序列化输入流的字节数上限 maxarray=value // 单次反序列化输入流中数组数上限
// 以下示例介绍了限制反序列化的类名称的配置方法 // 允许唯一类 org.example.Teacher ,输入字节数最大为100,并阻止其它一切的类 jdk.serialFilter=maxbytes=100;org.example.Teacher;!* // 允许 org.example. 下的所有类,输入字节数最大为100,并阻止其它一切的类 jdk.serialFilter=maxbytes=100;org.example.*;!* // 允许 org.example. 下的所有类和子类,输入字节数最大为100,并阻止其它一切的类 jdk.serialFilter=maxbytes=100;org.example.**;!* //允许一切类 jdk.serialFilter=*; ; 作为表达式的分隔符 .* 代表当前包下的所有类 .** 代表当前包下所有类和所有子类 ! 代表取反,禁止匹配符号后的表达式被反序列化 * 通配符
jdk11+:%JAVA_HOME%\conf\security\java.security jdk8: %JAVA_HOME%\jre\lib\security\java.security
java -Djdk.serialFilter=org.example.**;maxbytes=100;!*
Properties props = System.getProperties(); props.setProperty("jdk.serialFilter", "org.example.**;maxbytes=100;!*");
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: