Information
Java provides configuration to allow incoming streams of object-serialization data to be filtered in order to improve both security and robustness. This allows
There have been issues with deserialization of untrusted data in Java. To mitigate this, openJDK provides a flexible mechanism using filters to restrict the classes that can be deserialized. In addition, it also provides metrics to control the filter size, depth etc.
Solution
Set the System property jdk.serialFilter in the ${server.config.dir}/bootstrap.properties file to the correct filters to restrict classes to be deserialized. For example,
jdk.serialFilter=!com.myCompany.restrictClass;com.myCompany.allowClass
Impact:
The filters to allow classes to be deserialized or deny classes to be serialized should be based on individual scenarios. They need to be done with care to mitigate any side impacts. More information in the links provided in the reference section.