File tree Expand file tree Collapse file tree 2 files changed +4
-23
lines changed
aws-android-sdk-core/src/main/java/com/amazonaws Expand file tree Collapse file tree 2 files changed +4
-23
lines changed Original file line number Diff line number Diff line change @@ -109,10 +109,9 @@ private static List<Region> internalParse(
109109 Document document ;
110110 try {
111111
112- DocumentBuilderFactory factory = DocumentBuilderFactory .newInstance ();
113- factory .setFeature ("http://apache.org/xml/features/disallow-doctype-decl" , true );
114- factory .setXIncludeAware (false );
115- factory .setExpandEntityReferences (false );
112+ DocumentBuilderFactory factory =
113+ DocumentBuilderFactory .newInstance ();
114+
116115 DocumentBuilder documentBuilder = factory .newDocumentBuilder ();
117116 document = documentBuilder .parse (input );
118117
Original file line number Diff line number Diff line change @@ -45,25 +45,7 @@ public class XpathUtils {
4545 /** Shared logger */
4646 private static Log log = LogFactory .getLog (XpathUtils .class );
4747
48- private static DocumentBuilderFactory factory = getDocumentBuilderFactory ();
49-
50-
51- /**
52- * Creates new documentbuilderfactory object
53- * @return DocumentBuilderFactory.
54- */
55- private static DocumentBuilderFactory getDocumentBuilderFactory () {
56- try {
57- DocumentBuilderFactory dbf = DocumentBuilderFactory .newInstance ();
58- dbf .setFeature ("http://apache.org/xml/features/disallow-doctype-decl" , true );
59- dbf .setXIncludeAware (false ); // Default false for java 8. Disable XML Inclusions leading to SSRF - https://portswigger.net/web-security/xxe/lab-xinclude-attack
60- dbf .setExpandEntityReferences (false );
61- return dbf ;
62- }
63- catch (ParserConfigurationException exception ){
64- return null ;
65- }
66- }
48+ private static DocumentBuilderFactory factory = DocumentBuilderFactory .newInstance ();
6749
6850 /**
6951 * InputStream to Document.
You can’t perform that action at this time.
0 commit comments