Skip to content

Instantly share code, notes, and snippets.

@hoomanb1
Created August 2, 2017 23:11
protected Class<?> resolveClass(ObjectStreamClass desc)
throws IOException, ClassNotFoundException {
String name = desc.getName();
if(isBlacklisted(name) ) {
throw new SecurityException("Deserialization is blocked for security reasons");
}
if(isWhitelisted(name) ) {
throw new SecurityException("Deserialization is blocked for security reasons");
}
return super.resolveClass(desc);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment