Package org.wildfly.common.xml
Class DocumentBuilderFactoryUtil
java.lang.Object
org.wildfly.common.xml.DocumentBuilderFactoryUtil
Factory provides
DocumentBuilderFactory with secure defaults set. Properties not supported generate a warning, but
the factory process creation will continue and return a result.
Settings based on recommendations of
Sonarcloud RSPEC-2755 and
OWASP XML
External Entity Prevention Cheatsheet.
XMLConstants.FEATURE_SECURE_PROCESSINGis set to true.XMLConstants.ACCESS_EXTERNAL_DTDis set to empty.XMLConstants.ACCESS_EXTERNAL_SCHEMAis set to empty.FactoryConstants.APACHE_DISALLOW_DOCTYPE_DECLis set to true.FactoryConstants.APACHE_LOAD_EXTERNAL_DTDis set to false.FactoryConstants.XML_EXTERNAL_GENERAL_ENTITIESis set to false.FactoryConstants.XML_EXTERNAL_PARAMETER_ENTITIESis set to false.DocumentBuilderFactory.setXIncludeAware(boolean)is set to false.DocumentBuilderFactory.setExpandEntityReferences(boolean)is set to false.
- Since:
- 1.6.0.Final
- Author:
- Boris Unckel
-
Method Summary
Modifier and TypeMethodDescriptionstatic DocumentBuilderFactorycreate()Factory generated with secure defaults.
-
Method Details
-
create
Factory generated with secure defaults.- Returns:
- an instance of the DocumentBuilderFactory.
-