github-advanced-security[bot] commented on code in PR #749:
URL: https://github.com/apache/creadur-rat/pull/749#discussion_r4274104285


##########
apache-rat-maven-parent/plugin/src/main/java/org/apache/rat/maven/RatReportMojo.java:
##########
@@ -390,11 +399,23 @@
         return !skip;
     }
 
+    @SuppressFBWarnings("XXE_DOCUMENT")
+    Reporter.Output readReportFile() throws MavenReportException {
+        File f = new File(outputDirectory, "RAT/rat.xml");
+        try (InputStream inputStream = new FileInputStream(f)) {
+            return 
Reporter.Output.builder().document(DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(inputStream)).build();

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



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