getResourceAsStream() from Applets provides access to .class files in JARs

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P2
    • 1.1.5
    • Affects Version/s: 1.1
    • Component/s: core-libs
    • None
    • 1.1.5
    • generic
    • generic
    • Not verified

      A class loaded through the AppletClassLoader can get the contents of a .class file located in a JAR file (cf. in a directory) in CLASSPATH through getSystemResourceAsStream(). This could be used by a malicious applet to read .class information and decompile algorithms it should not have access to.

      Replicate as follows:

      Get the attachement tar file, untar it first, then follow the instructions in GetResourceTests.java in the attachment. The failure says:

      calterra% setenv CLASSPATH /home/pelegri/tst/getresource/new/data.jar

      calterra% appletviewer OnJarFromApplet.html
      Tests failed java.lang.Exception: could read foo.class using getResourceAsStream

            Assignee:
            Eduardo Pelegrillopart (Inactive)
            Reporter:
            Eduardo Pelegrillopart (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: