Security Bug in PHP 5.3.6

21 November 2011
As SANS is reporting at there is an issue with PHP 5.3.7 that could have security implications. I was able to confirm this bug report. However, while this bug is problematic, it is only reported to affect the crypt() function (, and not in any sort of exploitable compromise kind of way that I can think of (which isn't to say one doesn't exist). The report states there is an issue with the way the crypt function handles MD5 ( The default algorithm for the crypt function is DES and most PHP programs would probably use the md5() function ( instead of the crypt() function to generate an MD5 so I think use in this scenario is an edge case. Normally the function performs an encryption operation with an optional salt. According to the bug report if you call the function, specifying that you want an MD5 return value (determined by the format of the salt), and you pass in a salt, the return value is actually just the salt. If you aren't using a salt, or if you're using another format for the salt, then there isn't an issue. PHP 5.3.7 was released (on August 18th) to address several security issues with earlier 5.3.x releases (including a buffer overflow, a stack overflow, and file path injection vulnerability Ref:, so if you aren't using the crypt function, or if you aren't using MD5 salts with the crypt function the upgrade might still be worthwhile. However, reports that PHP 5.3.8 is going to be available soon ("expected in few days"). Ref: [Update: PHP 5.3.8 has been released as of August 24, 2011]