Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.InvalidClassException;
import java.io.ObjectInputFilter;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.ObjectStreamClass;
Expand Down Expand Up @@ -103,6 +104,7 @@ public static Serializable deserializeObject(final String string) {
private final static class SafeObjectInputStream extends ObjectInputStream {
public SafeObjectInputStream(InputStream in) throws IOException {
super(in);
setObjectInputFilter(ObjectInputFilter.Config.createFilter("maxdepth=10"));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.regex.Pattern;

import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;

import com.amazon.dlic.auth.ldap.LdapUser;
Expand Down Expand Up @@ -58,15 +57,10 @@ public final class SafeSerializationUtils {
Number.class,
Collection.class,
Map.class,
Enum.class,
ImmutableMap.class
Enum.class
);

private static final Set<String> SAFE_CLASS_NAMES = Set.of(
"org.ldaptive.LdapAttribute$LdapAttributeValues",
"com.google.common.collect.ImmutableBiMap$SerializedForm",
"com.google.common.collect.ImmutableMap$SerializedForm"
);
private static final Set<String> SAFE_CLASS_NAMES = Set.of("org.ldaptive.LdapAttribute$LdapAttributeValues");
static final Map<Class<?>, Boolean> safeClassCache = new ConcurrentHashMap<>();

static boolean isSafeClass(Class<?> cls) {
Expand Down
Loading