URL.openConnection can throw IOOBE

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 20
    • Affects Version/s: 18
    • Component/s: core-libs
    • None
    • b19

      An incomplete input validation in the URL class can cause an IOOBE to be
      thrown from the openConnection method, where according to the API
      documentation no exception is expected to be thrown.

      A jshell PoC:

      jshell> new URL("ftp://.:%@")
      $1 ==> ftp://.:%@

      jshell> $1.openConnection()
      | Exception java.lang.IndexOutOfBoundsException
      | at Integer.parseInt (Integer.java:706)
      | at ParseUtil.unescape (ParseUtil.java:163)
      | at ParseUtil.decode (ParseUtil.java:199)
      | at FtpURLConnection.<init> (FtpURLConnection.java:204)
      | at Handler.openConnection (Handler.java:61)
      | at Handler.openConnection (Handler.java:56)
      | at URL.openConnection (URL.java:1126)
      | at (#2:1)
        

            Assignee:
            Daniel Fuchs
            Reporter:
            Marc Schönefeld
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: