[php-src] Issue #21673: password_verify() failed to verify bcrypt passwords containing null bytes
| From: | LamentXU123 | Date: | Wed, 08 Apr 2026 11:04:31 +0000 |
| Subject: | [php-src] Issue #21673: password_verify() failed to verify bcrypt passwords containing null bytes | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-251910@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/21673
Author: LamentXU123
### Description
The following code:
```php
<?php
$hash = password_hash("secret", PASSWORD_BCRYPT);
var_dump(password_verify("secret", $hash));
var_dump(password_verify("secret" . chr(0) . "suffix", $hash));
?>
```
Resulted in this output:
```
bool(true)
bool(true)
```
But I expected this output instead:
```
bool(true)
bool(false)
```
### PHP Version
```plain
all supported version
```
### Operating System
_No response_