Skip to content
This repository was archived by the owner on Mar 20, 2021. It is now read-only.
This repository was archived by the owner on Mar 20, 2021. It is now read-only.

ELFlash sometimes throws ArrayIndexOutOfBoundsException if cookie contains invalid values #4386

Description

@erdbeerschnitzel

JSF-Version 2.2.18

The Flash cookie ("csfcfc") with value '7aXBAow%3D' can result in:

java.lang.ArrayIndexOutOfBoundsException: null
--
at java.lang.System.arraycopy(Native Method)
at com.sun.faces.util.ByteArrayGuardAESCTR.decrypt(ByteArrayGuardAESCTR.java:158)
at com.sun.faces.context.flash.ELFlash$PreviousNextFlashInfoManager.decode(ELFlash.java:1414)
at com.sun.faces.context.flash.ELFlash.getCurrentFlashManager(ELFlash.java:1235)
at com.sun.faces.context.flash.ELFlash.doPrePhaseActions(ELFlash.java:619)
at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:215)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:99)
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:123)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:658)

I guess the problem is in the method

private PreviousNextFlashInfoManager getCurrentFlashManager(FacesContext context, Map<Object, Object> contextMap, Cookie cookie)

because only InvalidKeyException is caught there.

Activity

  1. nalmeida84 commented on Feb 28, 2019

    @nalmeida84

    Same problem, solved clearing the cookies. Thanks for your post!

  2. added a commit that references this issue on Jan 24, 2020
    d440288
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions