Skip to content

ext/standard: notice on long passwords in bcrypt - #23076

Draft
Sjord wants to merge 2 commits into
php:masterfrom
Sjord:bcrypt-72-notice
Draft

ext/standard: notice on long passwords in bcrypt#23076
Sjord wants to merge 2 commits into
php:masterfrom
Sjord:bcrypt-72-notice

Conversation

@Sjord

@Sjord Sjord commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Bcrypt supports passwords up to 72 characters. The remainder is ignored.

Earlier proposed here:

Bcrypt truncation can result in serious security bugs:

@Sjord

Sjord commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

This could also apply to crypt. However, with crypt there is not a distinction between creating the hash and verifying the hash, as there is with password_hash / password_verify, which means that anyone that can access to login screen can trigger the notice by entering a long password. That makes the notice less meaningful and bigger chance of BC break.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant