#34704 [Opn->Fbk]: Infinite recursion due to corrupt JPEG
| From: | sniper@php.net | Date: | Sun, 02 Oct 2005 11:05:31 +0000 |
| Subject: | #34704 [Opn->Fbk]: Infinite recursion due to corrupt JPEG | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-85876@lists.php.net to get a copy of this message | ||
ID: 34704
Updated by: sniper@php.net
Reported By: t dot starling at physics dot unimelb dot edu dot au
-Status: Open
+Status: Feedback
Bug Type: EXIF related
Operating System: linux
PHP Version: 4.4.0
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2005-10-02 09:07:14] t dot starling at physics dot unimelb dot edu dot
au
Description:
------------
An image, seen in the wild and probably generated non-maliciously,
reliably causes exif_read_data() to go into infinite recursion.
I've fixed the problem and created a patch against PHP 4.4.0:
http://wikimedia.org/~tstarling/php/exif_IFD2.patch
The test image is here:
http://wikimedia.org/~tstarling/php/Carcraftbuckett.jpg
The problem was an assumption that images would follow the spec and
include a maximum of 2 IFD headers, IFD0 for the image and IFD1 for the
thumbnail. The test image probably has the "next IFD offset" field
pointing back to the same structure, creating an infinite loop. I
haven't studied the test image in detail, but my patch allows PHP's
Exif functions to read it without segfaulting, which is good enough for
me.
I decided to ignore any further IFDs beyond the first two rather than
issue an error, for compatibility with possible future revisions of the
Exif spec.
-- Tim Starling (MediaWiki developer)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34704&edit=1