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

Open
@erdbeerschnitzel

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.

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