Bug 1378760 (CVE-2016-7528) - CVE-2016-7528 ImageMagick: out of bound access for viff file coder
Summary: CVE-2016-7528 ImageMagick: out of bound access for viff file coder
Keywords:
Status: CLOSED WONTFIX
Alias: CVE-2016-7528
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: 1378790
Blocks: 1378785
TreeView+ depends on / blocked
 
Reported: 2016-09-23 08:52 UTC by Adam Mariš
Modified: 2021-02-17 03:17 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-05-19 09:09:21 UTC
Embargoed:


Attachments (Terms of Use)

Comment 1 Adam Mariš 2016-09-23 09:35:19 UTC
Created ImageMagick tracking bugs for this issue:

Affects: fedora-all [bug 1378790]

Comment 2 Stefan Cornelius 2016-09-29 10:45:48 UTC
coders/viff.c:
> number_pixels=(MagickSizeType) image->columns*image->rows;
> for (y=0; y < (ssize_t) image->rows; y++)
> {
>   q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
>   if (q == (PixelPacket *) NULL)
>    break;
>   for (x=0; x < (ssize_t) image->columns; x++)
>   {
>       SetPixelRed(q,ScaleCharToQuantum(*p));
>       SetPixelGreen(q,ScaleCharToQuantum(*(p+number_pixels)));
>       SetPixelBlue(q,ScaleCharToQuantum(*(p+2*number_pixels)));
>       if (image->colors != 0)

Depending on the image dimensions, number_pixels can be quite large
> number_pixels=(MagickSizeType) image->columns*image->rows;

This causes problems when adding this to "p" to calculate the address. It could wrap around and cause an access to invalid memory.
>       SetPixelGreen(q,ScaleCharToQuantum(*(p+number_pixels)));
>       SetPixelBlue(q,ScaleCharToQuantum(*(p+2*number_pixels)));

I'm not sure if the upstream patch properly protects against that.

Comment 3 Stefan Cornelius 2017-05-19 09:09:38 UTC
Statement:

Red Hat Product Security has rated this issue as having Moderate security impact. This issue is not currently planned to be addressed in future updates. For additional information, refer to the Issue Severity Classification: https://access.redhat.com/security/updates/classification/.


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