|
@@ -80,7 +80,14 @@ public class GetWxOrderno {
|
|
|
|
|
|
Map<String, String> m = new HashMap<String, String>();
|
|
Map<String, String> m = new HashMap<String, String>();
|
|
InputStream in = string2Inputstream(strxml);
|
|
InputStream in = string2Inputstream(strxml);
|
|
|
|
+
|
|
SAXBuilder builder = new SAXBuilder();
|
|
SAXBuilder builder = new SAXBuilder();
|
|
|
|
+ // 防止XXE
|
|
|
|
+ builder.setFeature("(http://apache.org/xml/features/disallow-doctype-decl", true);
|
|
|
|
+ builder.setFeature("(http://xml.org/sax/features/external-general-entities", false);
|
|
|
|
+ builder.setFeature("(http://xml.org/sax/features/external-parameter-entities", false);
|
|
|
|
+ builder.setFeature("(http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
|
|
|
|
+
|
|
Document doc = builder.build(in);
|
|
Document doc = builder.build(in);
|
|
Element root = doc.getRootElement();
|
|
Element root = doc.getRootElement();
|
|
List<Element> list = root.getChildren();
|
|
List<Element> list = root.getChildren();
|