Details
-
Improvement
-
Resolution: Fixed
-
Major
-
18.8.0
-
None
-
Unit
-
Unknown
-
Description
CSRF tokens are kept in a JVM-local map (DefaultCSRFToken). In a cluster behind a load balancer without sticky sessions, a form rendered by one node and submitted to another is rejected ("Secret CSRF token verification failed"), and a node restart invalidates every open form.
Proposal: derive the token deterministically with an HMAC of the authentication validation key (xwiki.authentication.validationKey, which a cluster already has to share for cookies to work) and the user reference, so every node computes the same token. Compare tokens in constant time.
Attachments
Issue Links
- relates to
-
XWIKI-25244 Log an error when clustering is enabled but the authentication keys are not configured
-
- Closed
-