Bug #66835 [NEW]: password_verifiy

From: Date: Thu, 06 Mar 2014 13:39:22 +0000
Subject: Bug #66835 [NEW]: password_verifiy
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-184573@lists.php.net to get a copy of this message
From: pl dot lamballais at flashover dot fr Operating system: Linux PHP version: 5.5.10 Package: *General Issues Bug Type: Bug Bug description:password_verifiy Description: ------------ --- From manual page: http://www.php.net/function.password-verify --- System is:Linux webd497.20gp.ha.ovh.net 3.10.23-grsec-mutu-grs-ipv6-64+ #42 SMP Wed Feb 26 12:45:33 CET 2014 x86_64 PHP version is 5.5.7 Notice a strange comportemnt of password_verify() depending on the fact the hash variable is using ' or ". I start to think this affect also the hash builder as I've some user records in my database which are seen as "correct" using password_verify and others which are seen as "bad password" when in fact they are all build the same way. Test script: --------------- // First exemple will give "Password is valid!" $hash = '$2y$07$BCryptRequires22Chrcte/VlQH0piJtjXl.0t1XkA8pw9dMXTpOq'; if (password_verify('rasmuslerdorf', $hash)) { echo 'Password is valid!';} else { echo 'Invalid password.';} // But this one will will give "Invalid password!" $hash = "$2y$07$BCryptRequires22Chrcte/VlQH0piJtjXl.0t1XkA8pw9dMXTpOq"; if (password_verify('rasmuslerdorf', $hash)) { echo 'Password is valid!';} else { echo 'Invalid password.';} -- Edit bug report at https://bugs.php.net/bug.php?id=66835&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66835&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66835&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66835&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=66835&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=66835&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=66835&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=66835&r=needscript Try newer version: https://bugs.php.net/fix.php?id=66835&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=66835&r=support Expected behavior: https://bugs.php.net/fix.php?id=66835&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=66835&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=66835&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=66835&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66835&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=66835&r=dst IIS Stability: https://bugs.php.net/fix.php?id=66835&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=66835&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=66835&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=66835&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=66835&r=mysqlcfg

« previous php.bugs (#184573) next »