Bug 996583

Summary: Endless loop on broken image files
Product: [Fedora] Fedora Reporter: Nils Philippsen <nphilipp>
Component: python-exifAssignee: Terje Røsten <terje.rosten>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: nphilipp, terje.rosten
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-exif-1.3.3-1.fc18 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-23 00:28:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Nils Philippsen 2013-08-13 13:25:37 UTC
Description of problem:
Attempting to read broken images (with EXIF.process_file()) can result in endless loops.

Version-Release number of selected component (if applicable):
python-exif-1.1.0-2.fc19.noarch

How reproducible:
Reproducible

Steps to Reproduce:
1. wget https://github.com/ianare/exif-samples/raw/master/jpg/invalid/image00971.jpg

2a. python -c 'import EXIF; EXIF.process_file(open("image00971.jpg", "rb"))'

OR:

2b. python -c 'import EXIF; EXIF.process_file(open("image00971.jpg", "rb"), debug=True)'

Actual results:
Endless loop, one CPU core hot (100%). With 2b), kilometers of:

[...]
Segment base 0x8B88
Unexpected/unhandled segment type or file content.
Got Segment base 0x8B88
Unexpected/unhandled segment type or file content.
Got Segment base 0x8B88
Unexpected/unhandled segment type or file content.
Got Segment base 0x8B88
Unexpected/unhandled segment type or file content.
Got Segment base 0x8B88
Unexpected/unhandled segment type or file content.
Got Segment base 0x8B88
[...]


Expected results:
Nothing, immediate return.

Additional info:

Comment 1 Nils Philippsen 2013-08-13 15:12:26 UTC
Upstream issue: https://github.com/ianare/exif-py/pull/10

Upstream commit fixing the issue: https://github.com/ianare/exif-py/commit/dbb7f291ec1e31ef256f3c3287cb376492402a7d

This is included in version 1.2.0 and later (1.3.3 is current). Newer tarballs seem to be in a different place than the download URL in the spec file, and it doesn't seem very RPM spec friendly (i.e. the URL's basename doesn't match the actual filename of the tarball):

https://github.com/ianare/exif-py/archive/1.3.3.tar.gz

Comment 2 Fedora Update System 2013-08-13 19:19:55 UTC
python-exif-1.3.3-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/python-exif-1.3.3-1.fc19

Comment 3 Fedora Update System 2013-08-13 19:20:03 UTC
python-exif-1.3.3-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/python-exif-1.3.3-1.fc18

Comment 4 Nils Philippsen 2013-08-14 08:45:49 UTC
Thanks for the quick fix!

Comment 5 Fedora Update System 2013-08-15 02:31:52 UTC
Package python-exif-1.3.3-1.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing python-exif-1.3.3-1.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-14690/python-exif-1.3.3-1.fc19
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2013-08-23 00:28:17 UTC
python-exif-1.3.3-1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2013-08-23 00:29:05 UTC
python-exif-1.3.3-1.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.