- java.lang.Object
-
- io.github.pixee.security.ValidatingObjectInputStreams
-
public final class ValidatingObjectInputStreams extends java.lang.ObjectThis type exposes helper methods that will help defend against Java deserialization attacks leveragingObjectInputStreamAPIs by wrapping it in an Apache Commons IOValidatingObjectInputStreamthat 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.ObjectInputStreamfrom(java.io.InputStream ois)This method returns a wrappedObjectInputStreamthat protects against deserialization code execution attacks.
-
-
-
Method Detail
-
from
public static java.io.ObjectInputStream from(java.io.InputStream ois) throws java.io.IOExceptionThis method returns a wrappedObjectInputStreamthat 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
ObjectInputStreamwhich is safe against all publicly known gadgets - Throws:
java.io.IOException- if the underlying creation ofObjectInputStreamfails
-
-