Document XML parser usage against security false positives
Prior to this commit, our XML parser usage would be already haredened against XXE (XML External Entities) attacks. Still, we recently received several invalid security reports claiming that our setup should be hardened. This commit documents a few usages of XML parsers to add some more context and hopefully prevent future invalid reports. Closes gh-33713
This commit is contained in:
@@ -157,6 +157,9 @@ final class PersistenceUnitReader {
|
||||
Document buildDocument(ErrorHandler handler, InputStream stream)
|
||||
throws ParserConfigurationException, SAXException, IOException {
|
||||
|
||||
// This document loader is used for loading application configuration files.
|
||||
// As a result, attackers would need complete write access to application configuration
|
||||
// to leverage XXE attacks. This does not qualify as privilege escalation.
|
||||
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
|
||||
dbf.setNamespaceAware(true);
|
||||
DocumentBuilder parser = dbf.newDocumentBuilder();
|
||||
|
||||
Reference in New Issue
Block a user