Improve jti-claim validator's handling of overly long values

Description

The section 11.1 of the DPoP RFC contains the following paragraph:

In order to guard against memory exhaustion attacks, a server that is tracking jti values should reject DPoP proof JWTs with unnecessarily large jti values or store only a hash thereof.

Currently our JWTIdentifierClaimsValidator simply stores/checks the raw jti value against the ReplayCache. It should be improved as suggested by the quote above.

Environment

None

Activity

Show:

Henri Mikkonen September 11, 2024 at 10:51 AM

After discussing with , we agreed that we want to add a Function<String,String>-hook to JWTIdentifierClaimsValidator to optionally calculate the replay cache key value from the jti.

The commit 18bf0d16ad4055986ee3221815caec45c622489a also includes a function (CalculateSha256DigestForLongKeyFunction) that calculates SHA-256 hex string for the inputs that are longer than 64 characters.

Completed

Details

Assignee

Reporter

Fix versions

Created September 11, 2024 at 9:10 AM
Updated October 18, 2024 at 8:46 AM
Resolved October 18, 2024 at 8:46 AM

Flag notifications