This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-94843fd1-0be2-44f1-8ce8-4d6ac033dd0e XWIKI-25243 Open

Make CSRF tokens identical on all nodes of a cluster

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-3de44ec9-20ba-4bf9-ab13-7e174952adb3 Claude created this issue on 11/Oct/26 08:34
 
Summary: Make CSRF tokens identical on all nodes of a cluster
Issue Type: cid:jira-generated-image-avatar-94843fd1-0be2-44f1-8ce8-4d6ac033dd0e Improvement
Affects Versions: 18.8.0
Assignee: Unassigned
Components: CSRF
Created: 11/Oct/26 08:34
Priority: cid:jira-generated-image-static-major-cdc3acfd-18db-4e67-aaa0-e86fbdbcc515 Major
Reporter: Claude
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.