Uploaded image for project: 'Tika'
  1. Tika
  2. TIKA-2731

Unecessary call to System.getProperties() in XMLReaderUtils

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.19
    • 1.19.1
    • core
    • None

    Description

      As part of the changes introduced in 1.19 determineMaxEntityExpansions needs to read the jdk.xml.entityExpansionLimit System Property in order to overwrite the default value of 20, if it is set.
      This is however by reading all System Properties with System.getProperties() and attempting to find the relevant key in the properties Object. The issue with this approach is that getProperties() requires

      java.util.PropertyPermission "*", "read,write"

      which is overly permissive.

      A more sane approach, following the least privilege design principal would be to use System.getProperty() for the specific property that only requires

      java.util.PropertyPermission "jdk.xml.entityExpansionLimit", "read"

       

      Attachments

        Issue Links

          Activity

            People

              tallison Tim Allison
              ikakavas Ioannis Kakavas
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: