Skip to content
Merged
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 @@ -27,6 +27,7 @@
import java.text.ParseException;
import java.util.Base64;
import java.util.Set;
import javax.xml.XMLConstants;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParserFactory;
import org.apache.commons.lang3.time.DateFormatUtils;
Expand All @@ -48,8 +49,6 @@ public class ParametersModalPanel extends AbstractModalPanel<ConfParam> {

protected static final JsonMapper JSON_MAPPER = JsonMapper.builder().findAndAddModules().build();

protected static final SAXParserFactory SAX_PARSER_FACTORY = SAXParserFactory.newInstance();

protected static boolean isDate(final String value) {
try {
DateFormatUtils.ISO_8601_EXTENDED_DATETIME_TIME_ZONE_FORMAT.parse(value);
Expand Down Expand Up @@ -79,9 +78,12 @@ protected static boolean isJSON(final String value) {

protected static boolean isXML(final String value) {
try {
SAX_PARSER_FACTORY.newSAXParser().getXMLReader().parse(new InputSource(new StringReader(value)));
SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE);
factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
factory.newSAXParser().getXMLReader().parse(new InputSource(new StringReader(value)));
return true;
} catch (IOException | ParserConfigurationException | SAXException xmle) {
} catch (IOException | ParserConfigurationException | SAXException e) {
return false;
}
}
Expand Down
Loading