Bug #74239 [NEW]: getimagesize returns incorrect value for corrupt file.

From: Date: Sun, 12 Mar 2017 10:12:05 +0000
Subject: Bug #74239 [NEW]: getimagesize returns incorrect value for corrupt file.
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-207806@lists.php.net to get a copy of this message
From: akaamitgupta at gmail dot com Operating system: Mac OSX PHP version: 5.6.30 Package: *General Issues Bug Type: Bug Bug description:getimagesize returns incorrect value for corrupt file. Description: ------------ I have wrapped an executable inside an image which has the following content - GIF89a<?php echo 'hacked'; ?> and saved it as filename image.gif. Whene I use getimagesize() PHP function then it returns array:6 [▼ 0 => 16188 1 => 26736 2 => 1 3 => "width="16188" height="26736"" "channels" => 3 "mime" => "image/gif" ] although image is not valid but still it has valid width and height. -- Edit bug report at https://bugs.php.net/bug.php?id=74239&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74239&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74239&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74239&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=74239&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=74239&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=74239&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=74239&r=needscript Try newer version: https://bugs.php.net/fix.php?id=74239&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=74239&r=support Expected behavior: https://bugs.php.net/fix.php?id=74239&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=74239&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=74239&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=74239&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74239&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=74239&r=dst IIS Stability: https://bugs.php.net/fix.php?id=74239&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=74239&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=74239&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=74239&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=74239&r=mysqlcfg

« previous php.bugs (#207806) next »