Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 506896 - (CVE-2009-2687) CVE-2009-2687 php: exif_read_data crash on corrupted JPEG files
CVE-2009-2687 php: exif_read_data crash on corrupted JPEG files
Status: CLOSED ERRATA
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
medium Severity medium
: ---
: ---
Assigned To: Red Hat Product Security
source=internet,reported=20090618,pub...
: Security
Depends On: 541594 541595 541596 541597 541598
Blocks:
  Show dependency treegraph
 
Reported: 2009-06-19 03:31 EDT by Tomas Hoger
Modified: 2013-02-01 10:07 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-01-14 04:24:05 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2009:1461 normal SHIPPED_LIVE Important: Red Hat Application Stack v2.4 security and enhancement update 2009-09-23 17:38:40 EDT
Red Hat Product Errata RHSA-2010:0040 normal SHIPPED_LIVE Moderate: php security update 2010-01-13 13:09:32 EST

  None (edit)
Description Tomas Hoger 2009-06-19 03:31:28 EDT
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 03:35:16 EDT
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 12:18:59 EDT
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 11:31:13 EDT
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 11:33:16 EDT
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 15:52:44 EDT
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 17:38:49 EDT
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 13:10:06 EST
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.