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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 6.20.0
    • 7.3.0, 8.0.0-M1, 6.23.0
    • wicket
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: