Skip to content

compare admin console credentials in constant time - #1307

Merged
cortlepp merged 1 commit into
apache:masterfrom
kali834x:admin-login-constant-time
Oct 9, 2026
Merged

cortlepp merged 1 commit into
apache:masterfrom
kali834x:admin-login-constant-time

Conversation

@kali834x

@kali834x kali834x commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

the admin console login in AdminActions.login checked the configured username and password with String.equals, which bails out at the first differing character and short-circuits the && between the two checks, so the time to reject a guess tracks how much of a correct prefix it carried. the login action is reachable without authentication (authorizationRequired=false), so that timing is observable to a remote caller (CWE-208). this routes both comparisons through a constant-time constantTimeEquals using MessageDigest.isEqual over the utf-8 bytes and combines them with a non-short-circuiting & so the time no longer depends on where the first mismatch falls. correct credentials still authenticate and a null configured value still fails closed.

@cortlepp
cortlepp merged commit dcbe19c into apache:master Oct 9, 2026
5 checks passed
@cortlepp

cortlepp commented Oct 9, 2026

Copy link
Copy Markdown
Member

@kali834x merged, thanks!

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.

2 participants