【问题标题】:XML External Entity Injection (Input Validation and Representation, Data Flow)XML 外部实体注入(输入验证和表示,数据流)
【发布时间】:2015-06-08 10:59:00
【问题描述】:

当我运行 HP fortify 时,以下代码作为 XML 外部实体注入给出。问题行指定为错误行。感谢任何帮助。

private Document parseXmlString(String stringname, boolean validating) {
        try {

            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            factory.setValidating(validating);

            ByteArrayInputStream is = new ByteArrayInputStream(stringname.getBytes());


            Document doc = factory.newDocumentBuilder().parse(is);//Error Line
                return doc;
            } catch (SAXException e) {
                // A parsing error occurred; the xml input is not valid
            } catch (ParserConfigurationException e) {

            } catch (IOException e) {
            }
            return null;
    }

【问题讨论】:

    标签: java xml dom xml-parsing xmldocument


    【解决方案1】:

    【讨论】:

      猜你喜欢
      • 2017-06-26
      • 2016-05-23
      • 2016-11-09
      • 2015-11-17
      • 1970-01-01
      • 2019-06-24
      • 1970-01-01
      • 1970-01-01
      • 2023-04-02
      相关资源
      最近更新 更多