Bug #62443 [Asn->Csd]: Crypt SHA256/512 Segfaults With Malformed Salt
| From: | ircmaxell@php.net | Date: | Fri, 29 Jun 2012 02:48:18 +0000 |
| Subject: | Bug #62443 [Asn->Csd]: Crypt SHA256/512 Segfaults With Malformed Salt | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-171613@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=62443&edit=1
ID: 62443
Updated by: ircmaxell@php.net
Reported by: ircmaxell@php.net
Summary: Crypt SHA256/512 Segfaults With Malformed Salt
-Status: Assigned
+Status: Closed
Type: Bug
Package: Reproducible crash
Operating System: All
PHP Version: master-Git-2012-06-28 (Git)
Assigned To: ircmaxell
Block user comment: N
Private report: N
New Comment:
This has been fixed in the 5.3, 5.4 and master branches.
Previous Comments:
------------------------------------------------------------------------
[2012-06-29 01:03:13] ircmaxell@php.net
Automatic comment on behalf of ircmaxell@ircmaxell.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=7e8276ca68fc622124d51d18e4f7b5cde3536de4
Log: Fixed bug #62443 (Crypt SHA256/512 Segfaults With Malformed Salt)
------------------------------------------------------------------------
[2012-06-29 00:02:33] ircmaxell@php.net
Description:
------------
Crypt() SHA256 and SHA512 segfault when passed a salt that contains a null byte.
This is because the emalloc call and the memset call use different length inputs
for the
output string. The memset call then overflows the buffer.
Test script:
---------------
<?php
crypt("foo", '$5$'.chr(0).'abc');
?>
and
<?php
crypt("foo", '$6$'.chr(0).'abc');
?>
Expected result:
----------------
No output
Actual result:
--------------
Either segmentation fault (sha512) or zend_mm_heap corrupted (sha256)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=62443&edit=1