Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-28495

Validator.isHostName() rejects IPv6 addresses

    Details

      Description

      With IPv6 addressing localhost is resolved as 0:0:0:0:0:0:0:1 so it should be fine to access my local portal as http://[0:0:0:0:0:0:0:1]:8080 (this is translated as http://[::1]:8080) but I get HTTP Status 500 as ValidHostNameFilter throws:

      java.lang.RuntimeException: Invalid host name [::1]
      	com.liferay.portal.servlet.filters.validhostname.ValidHostNameFilter.doFilterTry(ValidHostNameFilter.java:36)
      	com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:185)
      	com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
      	com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:71)
      

      The root cause is that ValidHostNameFilter uses Validator.isHostName(serverName) and isHostName validates hostnames that contains only digits, characters, dash or period but not colon nor open and close bracket.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              michael.saechang Michael Saechang
              Reporter:
              vilmos.papp Vilmos Papp
              Participants of an Issue:
              Recent user:
              Esther Sanz
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                8 years, 50 weeks ago

                  Packages

                  Version Package
                  6.0.X EE
                  6.1.1 CE GA2
                  6.1.20 EE GA2
                  6.2.0 CE M2