JWKS cache never expires — key rotation requires restart #58

Closed
opened 2026-03-30 13:28:52 +00:00 by sharang · 1 comment
Owner

fetch_or_get_jwks caches JWKS forever. When Keycloak rotates signing keys, all new tokens are rejected until the process restarts. Fix: Add TTL (5 min) and force-refresh fallback when kid is not found.

fetch_or_get_jwks caches JWKS forever. When Keycloak rotates signing keys, all new tokens are rejected until the process restarts. Fix: Add TTL (5 min) and force-refresh fallback when kid is not found.
sharang added the bugsecurityv0.3.0critical labels 2026-03-30 13:28:52 +00:00
Author
Owner

Fixed on main. Key rotation needs no restart: when a token's kid is not in the cached JWKS, or its signature fails, the middleware refreshes the JWKS once and validates again (compliance-core/src/auth.rs, "JWKS appears stale — forcing refresh and retrying"; #84). A fixed TTL is not needed on top of that.

Fixed on main. Key rotation needs no restart: when a token's `kid` is not in the cached JWKS, or its signature fails, the middleware refreshes the JWKS once and validates again (`compliance-core/src/auth.rs`, "JWKS appears stale — forcing refresh and retrying"; #84). A fixed TTL is not needed on top of that.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: platform/pruefwerk#58