Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-13991

clean up permissions in solr-tests.policy

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 8.4
    • Component/s: None
    • Labels:
      None

      Description

      The solr-tests.policy is currently way too lenient. Its useful for tests but pretty worthless at defending against any attacker "for real"

      For example imagine i can execute arbitrary java-ish code:

      Runtime.getRuntime().exec("id");
      

      With a security manager enabled, I'd get an exception like this:
      java.security.AccessControlException: access denied ("java.io.FilePermission" "<<ALL FILES>>" "execute")

      Because the current policy is so lenient and has wildcard RuntimePermission, the next thing i'd try (disable security manager, then launch process) would happily execute:

      System.setSecurityManager(null);Runtime.getRuntime().exec("id");
      

      That's because the current wildcard permission allows RuntimePermission("setSecurityManager").

      There are other variants I could use, some explained by java's docs: https://docs.oracle.com/javase/7/docs/api/java/lang/RuntimePermission.html

      It will take time and pain to clean up this stuff: e.g. fixing code and maybe even third-party dependencies, but gotta start somewhere. I think splitting up the wildcards is a good first step

        Attachments

        1. SOLR-13991.patch
          6 kB
          Robert Muir
        2. SOLR-13991.patch
          6 kB
          Robert Muir
        3. SOLR-13991.patch
          6 kB
          Robert Muir
        4. SOLR-13991.patch
          6 kB
          Robert Muir

          Issue Links

            Activity

              People

              • Assignee:
                rcmuir Robert Muir
                Reporter:
                rcmuir Robert Muir
              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: