coheigea commented on code in PR #3157:
URL: https://github.com/apache/cxf/pull/3157#discussion_r3339991221


##########
core/src/main/java/org/apache/cxf/staxutils/validation/W3CMultiSchemaFactory.java:
##########
@@ -139,6 +147,13 @@ public XMLValidationSchema createSchema(String baseURI,
             }
         }
         parserFactory = SAXParserFactory.newInstance();
+        try {
+            parserFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, 
Boolean.TRUE);
+            
parserFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl";,
 true);
+        } catch (SAXNotRecognizedException | SAXNotSupportedException | 
ParserConfigurationException e) {
+            LOG.log(Level.WARNING, "The properties '" + 
XMLConstants.FEATURE_SECURE_PROCESSING 
+                + "', 'http://apache.org/xml/features/disallow-doctype-decl' 
are not supported.");
+        }

Review Comment:
   Security parsers normally throw warnings on this kind of try/catch, because 
if for example the parser didn't support secure processing it will abort here 
and never disable DTDs. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to