Package mondrian.util
Class XmlParserFactoryProducer
java.lang.Object
mondrian.util.XmlParserFactoryProducer
Class was created to prevent XXE Security Vulnerabilities
http://jira.pentaho.com/browse/PPP-3506
Created by Yury_Bakhmutski on 10/21/2016.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic DocumentBuilderFactory
Creates an instance ofDocumentBuilderFactory
class with enabledXMLConstants.FEATURE_SECURE_PROCESSING
property.static SAXParserFactory
Creates an instance ofSAXParserFactory
class with enabledXMLConstants.FEATURE_SECURE_PROCESSING
property.static org.dom4j.io.SAXReader
getSAXReader
(EntityResolver resolver)
-
Constructor Details
-
XmlParserFactoryProducer
public XmlParserFactoryProducer()
-
-
Method Details
-
createSecureDocBuilderFactory
public static DocumentBuilderFactory createSecureDocBuilderFactory() throws ParserConfigurationExceptionCreates an instance ofDocumentBuilderFactory
class with enabledXMLConstants.FEATURE_SECURE_PROCESSING
property. Enabling this feature prevents from some XXE attacks (e.g. XML bomb) See PPP-3506 for more details.- Throws:
ParserConfigurationException
- if feature can't be enabled
-
createSecureSAXParserFactory
public static SAXParserFactory createSecureSAXParserFactory() throws SAXNotSupportedException, SAXNotRecognizedException, ParserConfigurationExceptionCreates an instance ofSAXParserFactory
class with enabledXMLConstants.FEATURE_SECURE_PROCESSING
property. Enabling this feature prevents from some XXE attacks (e.g. XML bomb)- Throws:
ParserConfigurationException
- if a parser cannot be created which satisfies the requested configuration.SAXNotRecognizedException
- When the underlying XMLReader does not recognize the property name.SAXNotSupportedException
- When the underlying XMLReader recognizes the property name but doesn't support the property.
-
getSAXReader
-