Created
May 6, 2018 00:52
-
-
Save conikeec/48bbdbdf954942100100d059b1622b8c to your computer and use it in GitHub Desktop.
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
protected void checkIllegalTypes(DeserializationContext ctxt, JavaType type, BeanDescription beanDesc) | |
throws JsonMappingException | |
{ | |
// There are certain nasty classes that could cause problems, mostly | |
// via default typing -- catch them here. | |
Class<?> raw = type.getRawClass(); | |
String name = raw.getSimpleName(); | |
if ("TemplatesImpl".equals(name)) { // [databind#1599] | |
if (raw.getName().startsWith("com.sun.org.apache.xalan")) { | |
throw JsonMappingException.from(ctxt, | |
String.format("Illegal type (%s) to deserialize: prevented for security reasons", name)); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment