8000 Updating Secure CIBA to reject overflowing and malformed timestamps by PadzerButch · Pull Request #54908 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Updating Secure CIBA to reject overflowing and malformed timestamps - #54908

Open
PadzerButch wants to merge 2 commits into
keycloak:mainfrom
PadzerButch:Weakness_54457_CIBA
Open

PadzerButch wants to merge 2 commits into
keycloak:mainfrom
PadzerButch:Weakness_54457_CIBA

Conversation

@PadzerButch
@PadzerButch PadzerButch commented Nov 9, 2026 •
Copy link
Copy Markdown
Contributor

relating to issue #54457

Closes #54906

Follows the same implementation as Request Objects

@PadzerButch
PadzerButch marked this pull request as ready for review November 10, 2026 10:39
@PadzerButch
PadzerButch requested a review from a team as a code owner November 10, 2026 10:39
Copilot AI balanced review requested due to automatic review settings November 10, 2026 10:39
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 nbf and 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

Copilot AI balanced review requested due to automatic review settings November 10, 2026 13:38
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Fractional timestamps can bypass the maximum lifetime check through truncation, and the expiration-boundary test can fail intermittently because it uses the live clock.

3 open issues

Review effort: Balanced

Comment on lines +154 to +155
signedAuthReq.put("exp", current);
executor.executeOnEvent(context);
…relating to issue keycloak#54457

Closes keycloak#54906

Signed-off-by: Paddy Buckley <paddy.buckley@ibm.com>
Copilot AI balanced review requested due to automatic review settings November 10, 2026 14:45
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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

Copilot AI balanced review requested due to automatic review settings November 10, 2026 15:43
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The expiration-boundary test remains timing-dependent and can fail after a scheduler or GC pause; a fixed clock is needed to make it deterministic.

1 open issue
1 resolved since last review

Review effort: Balanced

@mposolda mposolda left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PadzerButch Thanks! I have same comment like for your other PR #54907 - would be nice to test this in the integration test.

@mposolda mposolda self-assigned this Nov 11, 2026
Copilot AI balanced review requested due to automatic review settings November 11, 2026 16:20
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The zero-lifetime boundary test remains timing-dependent because a scheduler or GC pause between sampling the clock and validation can cause a valid request to fail as expired.

1 open issue

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 11, 2026 16:25
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the signed CIBA timestamp-validation and overflow-safety changes.

1 open issue

Review effort: Balanced

Signed-off-by: Paddy Buckley <paddy.buckley@ibm.com>
Copilot AI balanced review requested due to automatic review settings November 11, 2026 16:50
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified for the signed CIBA timestamp-validation and overflow-safety changes.

1 open issue

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reject overflowing and malformed timestamps in CIBA

3 participants

0