Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-6131

IndexOutOfBoundsException in org.apache.wicket.core.request.mapper.CryptoMapper.decryptEntireUrl

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.20.0
    • Fix Version/s: 7.3.0, 8.0.0-M1, 6.23.0
    • Component/s: wicket
    • Labels:
      None
    • Environment:
      Ubuntu Server

      Description

      We are getting following exception:

      java.lang.IndexOutOfBoundsException: Index: 2, Size: 2
      	at java.util.ArrayList.rangeCheck(ArrayList.java:653)
      	at java.util.ArrayList.get(ArrayList.java:429)
      	at org.apache.wicket.core.request.mapper.CryptoMapper.decryptEntireUrl(CryptoMapper.java:537)
      	at org.apache.wicket.core.request.mapper.CryptoMapper.decryptUrl(CryptoMapper.java:387)
      	at org.apache.wicket.core.request.mapper.CryptoMapper.getCompatibilityScore(CryptoMapper.java:189)
      	at org.apache.wicket.request.mapper.CompoundRequestMapper.mapRequest(CompoundRequestMapper.java:138)
      	at org.apache.wicket.request.cycle.RequestCycle.resolveRequestHandler(RequestCycle.java:190)
      	at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:215)
      	at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289)
      	at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:259)
      	at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:201)
      	at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:282)
      

      In order to fix it, you should change code in decryptEntireUrl from:

      		for (; segNo < encryptedNumberOfSegments; segNo++)
      		{
      			if (segNo > originalNumberOfSegments)
      			{
      				break;
      			}
      

      to

      		for (; segNo < encryptedNumberOfSegments; segNo++)
      		{
      			if (segNo >= originalNumberOfSegments) // > was replaced with >=
      			{
      				break;
      			}
      

        Attachments

          Activity

            People

            • Assignee:
              mgrigorov Martin Grigorov
              Reporter:
              mac.miklas Maciej Miklas
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: