File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
client/idrepo/console/src/main/java/org/apache/syncope/client/console/panels Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 2727import java .util .Base64 ;
2828import java .util .Set ;
2929import javax .ws .rs .core .MediaType ;
30+ import javax .xml .XMLConstants ;
3031import javax .xml .parsers .ParserConfigurationException ;
3132import javax .xml .parsers .SAXParserFactory ;
3233import org .apache .commons .lang3 .time .DateFormatUtils ;
@@ -48,8 +49,6 @@ public class ParametersModalPanel extends AbstractModalPanel<ConfParam> {
4849
4950 protected static final JsonMapper JSON_MAPPER = JsonMapper .builder ().findAndAddModules ().build ();
5051
51- protected static final SAXParserFactory SAX_PARSER_FACTORY = SAXParserFactory .newInstance ();
52-
5352 protected static boolean isDate (final String value ) {
5453 try {
5554 DateFormatUtils .ISO_8601_EXTENDED_DATETIME_TIME_ZONE_FORMAT .parse (value );
@@ -79,9 +78,12 @@ protected static boolean isJSON(final String value) {
7978
8079 protected static boolean isXML (final String value ) {
8180 try {
82- SAX_PARSER_FACTORY .newSAXParser ().getXMLReader ().parse (new InputSource (new StringReader (value )));
81+ SAXParserFactory factory = SAXParserFactory .newInstance ();
82+ factory .setFeature (XMLConstants .FEATURE_SECURE_PROCESSING , Boolean .TRUE );
83+ factory .setFeature ("http://apache.org/xml/features/disallow-doctype-decl" , true );
84+ factory .newSAXParser ().getXMLReader ().parse (new InputSource (new StringReader (value )));
8385 return true ;
84- } catch (IOException | ParserConfigurationException | SAXException xmle ) {
86+ } catch (IOException | ParserConfigurationException | SAXException e ) {
8587 return false ;
8688 }
8789 }
You can’t perform that action at this time.
0 commit comments