Skip to content

Fix invalid salt generation in change-password LDAP driver - #2160

Merged
the-djmaze merged 1 commit into
the-djmaze:masterfrom
stefansieg:fix/change-password-ldap-salt
Nov 26, 2026
Merged

the-djmaze merged 1 commit into
the-djmaze:masterfrom
stefansieg:fix/change-password-ldap-salt

Conversation

@stefansieg

Copy link
Copy Markdown

The regular expression in getSalt() is invalid. Even with a corrected regular expression, removing characters could result in a salt shorter than the requested length.

str_replace() replaces + with . instead, preserving the salt length and ensuring compatibility with CRYPT. Base64 padding is discarded by the existing substr() call.

Salt generation tested with PHP 8.4.

Fixes #1970.

@the-djmaze the-djmaze added bug Something isn't working extensions (plugin) labels Nov 26, 2026
@the-djmaze
the-djmaze merged commit fff58d4 into the-djmaze:master Nov 26, 2026
1 check passed
the-djmaze added a commit that referenced this pull request Nov 26, 2026
@stefansieg
stefansieg deleted the fix/change-password-ldap-salt branch November 26, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working extensions (plugin)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bugfix: change-password plugin does not set SSHA userPassword correctly in LDAP

2 participants