[php-src] Issue #21673: password_verify() failed to verify bcrypt passwords containing null bytes
[email protected] (LamentXU123)
| Newsgroups | php.bugs |
|---|---|
| Message-ID | <aPT10y9ffnP7nucZSxyMdjGfRaxHWW0NzsC4V6EsIoY@main.internal.php.net> |
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_