Bug 506896 (CVE-2009-2687) - CVE-2009-2687 php: exif_read_data crash on corrupted JPEG files
Summary: CVE-2009-2687 php: exif_read_data crash on corrupted JPEG files
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2009-2687
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 541594 541595 541596 541597 541598
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-06-19 07:31 UTC by Tomas Hoger
Modified: 2019-09-29 12:30 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-01-14 09:24:05 UTC


Attachments (Terms of Use)
Test case from the upstream bug (1.12 KB, application/x-compressed-tar)
2009-06-19 07:35 UTC, Tomas Hoger
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2009:1461 0 normal SHIPPED_LIVE Important: Red Hat Application Stack v2.4 security and enhancement update 2009-09-23 21:38:40 UTC
Red Hat Product Errata RHSA-2010:0040 0 normal SHIPPED_LIVE Moderate: php security update 2010-01-13 18:09:32 UTC

Description Tomas Hoger 2009-06-19 07:31:28 UTC
PHP 5.2.10 fixes one security issue:

  http://www.php.net/releases/5_2_10.php

  Fixed bug #48378 (exif_read_data() segfaults on certain corrupted .jpeg
  files). (Pierre)

Upstream bug report:
  http://bugs.php.net/bug.php?id=48378

Upstream patch:
  http://cvs.php.net/viewvc.cgi/php-src/ext/exif/exif.c#rev1.173.2.5.2.28

The issue is caused by insufficient validation of values read from the input file.  offset_of_ifd is used as index to the array, but its upper bound is not properly checked.  This can result in out-of-bounds read and crash of PHP interpreter, or disclose portions of its memory via EXIF header data used in script's output.

Comment 1 Tomas Hoger 2009-06-19 07:35:16 UTC
Created attachment 348617 [details]
Test case from the upstream bug

Source: http://bugs.php.net/bug.php?id=48378

Comment 2 Tomas Hoger 2009-06-26 16:18:59 UTC
This issue affect PHP versions shipped in Red Hat Enterprise Linux 3, 4 and 5, and Red Hat Application Stack v1 and v2.  Due to the limited impact of the flaw, there's no plan to release updates addressing only this flaw immediately, fix will be included in the next PHP security updates addressing more severe flaws.

Comment 3 Fedora Update System 2009-06-29 15:31:13 UTC
maniadrive-1.2-15.fc11,php-5.2.10-1.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/maniadrive-1.2-15.fc11,php-5.2.10-1.fc11

Comment 4 Fedora Update System 2009-06-29 15:33:16 UTC
php-5.2.10-1.fc10,maniadrive-1.2-15.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/php-5.2.10-1.fc10,maniadrive-1.2-15.fc10

Comment 5 Vincent Danen 2009-08-27 19:52:44 UTC
Note also that this only seems to affect php on the command-line:

# cat test.php 
<?php
echo "about to read ";
exif_read_data("hello-s148.jpeg","FILE,COMPUTED,ANY_TAG");
echo "read it";
?>
# php test.php 
about to read Segmentation fault
# tail /var/log/httpd/intranet-error_log -f
...
[Thu Aug 27 13:50:13 2009] [error] [client 192.168.250.50] PHP Warning:  exif_read_data() [<a href='function.exif-read-data'>function.exif-read-data</a>]: Unable to open 
/phpsysinfo/test/test.php on line 3

Loading test.php in the web browser shows:

about to read read it

No segmentation fault is recorded in the logs at all, and the web server continues to run so there is no real impact on security from a denial-of-service perspective unless you are using a CLI application.

Comment 6 errata-xmlrpc 2009-09-23 21:38:49 UTC
This issue has been addressed in following products:

  Red Hat Web Application Stack for RHEL 5

Via RHSA-2009:1461 https://rhn.redhat.com/errata/RHSA-2009-1461.html

Comment 8 errata-xmlrpc 2010-01-13 18:10:06 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 5
  Red Hat Enterprise Linux 4
  Red Hat Enterprise Linux 3

Via RHSA-2010:0040 https://rhn.redhat.com/errata/RHSA-2010-0040.html


Note You need to log in before you can comment on or make changes to this bug.