Uploaded image for project: 'Apache Freemarker'
  1. Apache Freemarker
  2. FREEMARKER-191

The class TaglibFactory.class may have XXE security issue

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 2.3.31
    • None
    • engine, jsp
    • None

    Description

      In the class  TaglibFactory, it provides the static method "parseXml" to parse the inputstream,  but it does not set security head,for example as below:

      xmlReader.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
      xmlReader.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
      xmlReader.setFeature("http://xml.org/sax/features/external-general-entities", false); 

      and then it may be attacked by XXE. So i think freemarker can add the above content first and parse the xml on next step, it will be better. Thanks

      Attachments

        1. TaglibFactory.java
          82 kB
          PowerCOM_STARWAR

        Activity

          People

            Unassigned Unassigned
            PowerCOM_STARWAR PowerCOM_STARWAR
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: