Bug 1301621 (CVE-2016-0775) - CVE-2016-0775 python-pillow: Buffer overflow in FliDecode.c
Summary: CVE-2016-0775 python-pillow: Buffer overflow in FliDecode.c
Keywords:
Status: CLOSED WONTFIX
Alias: CVE-2016-0775
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: 1300660
Blocks: 1298877 1301622
TreeView+ depends on / blocked
 
Reported: 2016-01-25 14:31 UTC by Adam Mariš
Modified: 2023-05-12 18:43 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-06-08 02:47:44 UTC
Embargoed:


Attachments (Terms of Use)

Description Adam Mariš 2016-01-25 14:31:22 UTC
A buffer overflow vulnerability in FliDecode.c was reported, affecting all versions of python-pillow at least from 1.1.7 release.

Vulnerable code:

case 16:
	/* COPY chunk */
    for (y = 0; y < state->ysize; y++) {
    UINT8* buf = (UINT8*) im->image[y];
    memcpy(buf+x, data, state->xsize);
    data += state->xsize;
    }
	break;

x is used in several internal temporary variable roles, but can take a value up to the width of the image from different chunk sizes. im->image[y] is a set of row pointers to segments of memory that are the size of the row. At the max y, this will write the contents of the line off the end of the memory buffer. This writes into python object storage in a region where there are function pointers.

Reproducer and proposed fix can be found in original bug report:

https://bugzilla.redhat.com/show_bug.cgi?id=1300660

Comment 3 Stefan Cornelius 2016-02-03 20:13:53 UTC
Acknowledgements:

Red Hat would like to thank the Pillow project for reporting this issue. Upstream acknowledges Alyssa Besseling as the original reporter.


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