Created
May 6, 2018 00:53
-
-
Save conikeec/b7daef7f1a7b65e3bd0eeacf61bff3e9 to your computer and use it in GitHub Desktop.
More dangerous classes were added to the blacklist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Set of well-known "nasty classes", deserialization of which is considered dangerous | |
* and should (and is) prevented by default. | |
* | |
* @since 2.8.9 | |
*/ | |
protected final static Set<String> DEFAULT_NO_DESER_CLASS_NAMES; | |
static { | |
Set<String> s = new HashSet<>(); | |
// Courtesy of [https://github.com/kantega/notsoserial]: | |
// (and wrt [databind#1599] | |
s.add("org.apache.commons.collections.functors.InvokerTransformer"); | |
s.add("org.apache.commons.collections.functors.InstantiateTransformer"); | |
s.add("org.apache.commons.collections4.functors.InvokerTransformer"); | |
s.add("org.apache.commons.collections4.functors.InstantiateTransformer"); | |
s.add("org.codehaus.groovy.runtime.ConvertedClosure"); | |
s.add("org.codehaus.groovy.runtime.MethodClosure"); | |
s.add("org.springframework.beans.factory.ObjectFactory"); | |
s.add("com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl"); | |
s.add("org.apache.xalan.xsltc.trax.TemplatesImpl"); | |
DEFAULT_NO_DESER_CLASS_NAMES = Collections.unmodifiableSet(s); | |
} | |
/** | |
* Set of class names of types that are never to be deserialized. | |
* | |
* @since 2.8.9 | |
*/ | |
protected Set<String> _cfgIllegalClassNames = DEFAULT_NO_DESER_CLASS_NAMES; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment