Repository navigation
Updating Secure CIBA to reject overflowing and malformed timestamps - #54908
PadzerButch wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The zero-lifetime boundary test can intermittently fail with Request Expired when setup and validation cross a second boundary, so it needs a frozen or mocked clock.
1 open issue
What changed in this PR
This PR hardens CIBA signed authentication request validation against timestamp coercion and lifetime overflow, extending the protection described in #54457 to address #54906.
Changes:
- Validates numeric timestamp claims and their conversion to
long. - Rejects expiration before
nbfand uses overflow-safe lifetime arithmetic. - Adds tests for valid lifetimes, timestamp boundaries, and malformed claims.
| File | Description |
|---|---|
| services/src/test/java/org/keycloak/protocol/oidc/grants/ciba/clientpolicy/executor/SecureCibaSignedAuthenticationRequestExecutorTest.java | Adds timestamp validation and lifetime regression tests. |
| services/src/main/java/org/keycloak/protocol/oidc/grants/ciba/clientpolicy/executor/SecureCibaSignedAuthenticationRequestExecutor.java | Adds timestamp validation and overflow-safe lifetime checks. |
Review effort: Balanced
20842a6 to
041e95d
Compare
| signedAuthReq.put("exp", current); | ||
| executor.executeOnEvent(context); |
…relating to issue keycloak#54457 Closes keycloak#54906 Signed-off-by: Paddy Buckley <paddy.buckley@ibm.com>
041e95d to
ffb791f
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
The zero-lifetime acceptance test uses the live clock, so crossing a second boundary before validation can trigger an unexpected Request Expired failure; a controlled clock is needed for deterministic testing.
2 open issues
1 resolved since last review
Review effort: Balanced
There was a problem hiding this comment.
@PadzerButch Thanks! I have same comment like for your other PR #54907 - would be nice to test this in the integration test.
18cf77e to
f89d420
Compare
f89d420 to
6df8baf
Compare
Signed-off-by: Paddy Buckley <paddy.buckley@ibm.com>
6df8baf to
4d49684
Compare

relating to issue #54457
Closes #54906
Follows the same implementation as Request Objects