github-advanced-security[bot] commented on code in PR #344:
URL: https://github.com/apache/creadur-whisker/pull/344#discussion_r4543929972


##########
apache-whisker-xml/src/main/java/org/apache/creadur/whisker/fromxml/JDomBuilder.java:
##########
@@ -600,8 +633,14 @@
                                organisations, contents);
        }
 
-       public Descriptor build(final InputStream xmlStream) throws 
JDOMException,
-                       IOException {
-               return build(new SAXBuilder().build(xmlStream));
+       /**
+        * Builds from the given input stream configured via Apache Commons 
Secure XML.
+        * @param xmlStream not null
+        * @return not null
+        * @throws JDOMException in case of XML errors.
+        * @throws IOException in case of general I/O errors.
+        */
+       public Descriptor build(final InputStream xmlStream) throws 
JDOMException, IOException {
+               return build(new 
SAXBuilder(secureXmlReaderFactory()).build(xmlStream));

Review Comment:
   ## SonarCloud / XML parsers should not be vulnerable to XXE attacks
   
   <!--SONAR_ISSUE_KEY:AaHMvS_yr3jilQPuyOdR-->Disable access to external 
entities in XML parsing. <p>See more on <a 
href="https://sonarcloud.io/project/issues?id=apache_creadur-whisker&issues=AaHMvS_yr3jilQPuyOdR&open=AaHMvS_yr3jilQPuyOdR&pullRequest=344";>SonarQube
 Cloud</a></p>
   
   [Show more 
details](https://github.com/apache/creadur-whisker/security/code-scanning/2)



-- 
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