Bug #62443 [Opn->Asn]: Crypt SHA256/512 Segfaults With Malformed Salt

From: Date: Fri, 29 Jun 2012 00:12:05 +0000
Subject: Bug #62443 [Opn->Asn]: Crypt SHA256/512 Segfaults With Malformed Salt
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-171612@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: Open +Status: Assigned Type: Bug Package: Reproducible crash Operating System: All PHP Version: master-Git-2012-06-28 (Git) -Assigned To: +Assigned To: ircmaxell Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#171612) next »