This issue has been created
There are 2 updates.
 
 
XWiki Platform / cid:jira-generated-image-avatar-0e7d26ce-f331-4c84-9069-24d85908473a XWIKI-25418 Open

Authentication failure strategies can break login or be skipped when they are changed while users log in

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-9027ac9c-2070-48d3-891e-842066d0b406 Michael Hamann created this issue on 20/Oct/26 11:14
 
Summary: Authentication failure strategies can break login or be skipped when they are changed while users log in
Issue Type: cid:jira-generated-image-avatar-0e7d26ce-f331-4c84-9069-24d85908473a Bug
Affects Versions: 11.7-rc-1
Assignee: Unassigned
Components: Authentication
Created: 20/Oct/26 11:14
Priority: cid:jira-generated-image-static-major-a3139d9e-cf1f-4b23-86aa-30044103735e Major
Reporter: Michael Hamann
Description:

The authentication failure strategies selected in the Authentication administration section (CAPTCHA, Disable account) are cached in memory for the whole farm and rebuilt when the configuration changes. This cache isn't safe when several requests use it at the same time: logins, display of the login page and REST requests using basic authentication all read it.

Impact

When an administrator changes the failure strategies while other users are logging in, two requests can rebuild the cache at the same time. The cached list of strategies can then stay damaged until the strategies are changed again or XWiki is restarted:

  • A user who reaches the maximum number of failed attempts gets an error page instead of the login form, and can't log in any more, even with the correct password, because every login attempt for this user fails with a NullPointerException.
  • A selected strategy can be skipped or applied twice, e.g. the account isn't disabled, or the CAPTCHA isn't requested, although the administrator selected it.

A request can also use an incomplete list of strategies while another request is rebuilding it.

In a farm where wikis select different strategies, the single cache is rebuilt each time a request comes from a different wiki than the previous one, which makes the problem above much more likely as soon as users log in to several wikis at the same time. A request can then also apply the strategies selected in another wiki.

Example

LoginProtectionIT#disableAccountStrategy failed on CI when the 4th failed login triggered the strategies, and the login page showed an error (stable-18.9.x build 10):

ERROR x.x.u.i.x.XWikiAuthServiceImpl - Failed to authenticate
java.lang.NullPointerException: Cannot read field "next" because "this.next" is null
	at java.base/java.util.LinkedList$ListItr.next(LinkedList.java:905)
	at org.xwiki.security.authentication.internal.DefaultAuthenticationFailureManager.recordAuthenticationFailure(DefaultAuthenticationFailureManager.java:217)
	at org.xwiki.security.authentication.AuthenticationFailureManager.recordAuthenticationFailure(AuthenticationFailureManager.java:50)
	at com.xpn.xwiki.user.impl.xwiki.MyFormAuthenticator.processLogin(MyFormAuthenticator.java:255)

The same request then failed again with the same exception while displaying the error message on the login page (AuthenticationScriptService#getErrorMessage), showing that the cached list itself was damaged.

 
 

2 updates

 
cid:jira-generated-image-avatar-9027ac9c-2070-48d3-891e-842066d0b406 Changes by Michael Hamann on 20/Oct/26 11:14
 
Fix Version: 18.10.0-rc-1
Assignee: Michael Hamann