Bug 1319666 (CVE-2016-3186)
| Summary: | CVE-2016-3186 libtiff: buffer overflow in gif2tiff | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Other] Security Response | Reporter: | Andrej Nemec <anemec> | ||||
| Component: | vulnerability | Assignee: | Red Hat Product Security <security-response-team> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | medium | ||||||
| Version: | unspecified | CC: | fridrich.strba, henri, phracek, sardella, security-response-team, slawomir | ||||
| Target Milestone: | --- | Keywords: | Security | ||||
| Target Release: | --- | ||||||
| Hardware: | All | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2019-06-08 02:49:58 UTC | Type: | --- | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Bug Depends On: | 1319503, 1322307, 1322309, 1322310 | ||||||
| Bug Blocks: | 1319667 | ||||||
| Attachments: |
|
||||||
|
Description
Andrej Nemec
2016-03-21 10:01:30 UTC
Acknowledgments: Name: Aladdin Mubaied Created libtiff tracking bugs for this issue: Affects: fedora-all [bug 1322307] Created mingw-libtiff tracking bugs for this issue: Affects: fedora-all [bug 1322309] Created mingw-libtiff tracking bugs for this issue: Affects: epel-7 [bug 1322310] Also disclosed on oss-security mailing list via: http://www.openwall.com/lists/oss-security/2016/03/30/2 Created attachment 1144235 [details]
Patch solving this buffer overflow
When getc detects that that it is at the end of file, it returns EOF which is a negative number. The exact value depends on implementation, but it is always a negative number. On Linux it is normally -1. That while loop check only if the count is <= 255. If the number count is negative, that condition is satisfied. Nonetheless, in the subsequent fread, the count is casted to size_t where it becomes a huge number, hence the buffer overflow. This patch is adding a check for the return of getc being positive, which solves the buffer overflow.
For your information I noticed additional buffer overflow issue in readgifimage(), which have been reported to upstream in http://bugzilla.maptools.org/show_bug.cgi?id=2552 CVE-2016-5102 has been assigned to buffer overflow issue in readgifimage(), which was reported in http://bugzilla.maptools.org/show_bug.cgi?id=2552 I am not sure how this should be reported to bugzilla.redhat.com as a separate issue. This issue has been addressed in the following products: Red Hat Enterprise Linux 7 Via RHSA-2019:2053 https://access.redhat.com/errata/RHSA-2019:2053 |