- java.lang.Object
-
- io.github.pixee.security.ValidatingObjectInputStreams
-
public final class ValidatingObjectInputStreams extends java.lang.Object
This type exposes helper methods that will help defend against Java deserialization attacks leveragingObjectInputStream
APIs by wrapping it in an Apache Commons IOValidatingObjectInputStream
that is configued to reject types that are known to be leveraged in deserialization attacksFor more information on deserialization checkout the OWASP Cheat Sheet.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.io.ObjectInputStream
from(java.io.InputStream ois)
This method returns a wrappedObjectInputStream
that protects against deserialization code execution attacks.
-
-
-
Method Detail
-
from
public static java.io.ObjectInputStream from(java.io.InputStream ois) throws java.io.IOException
This method returns a wrappedObjectInputStream
that protects against deserialization code execution attacks. This method can be used in Java 8 and previous.- Parameters:
ois
- the stream to wrap and harden- Returns:
- an
ObjectInputStream
which is safe against all publicly known gadgets - Throws:
java.io.IOException
- if the underlying creation ofObjectInputStream
fails
-
-