Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [day] [month] [year] [list]
Date: Thu, 31 Aug 2017 10:07:24 +0800
From: "孙浩" <>
To: "oss-security" <>
Cc: "张洪亮(望初)" <>,
  "Bob Friesenhahn" <>,
  "曲富平(杭特)" <>
Subject: CVE-2017-13777: GraphicsMagick 1.3.26 Denial of Service issue in ReadXBMImage() in coders/xbm.c

Hi all.
Description:graphicsmagick is a collection of tools and libraries for many image formats.
We found a denial of service (DoS) issue in xbm.c at line 314, GraphicsMagick-1.3.26.The vulnerable code snippet is shown as below.    313   if (version == 10)
    314     for (i=0; i < (long) (bytes_per_line*image->rows); (i+=2))
    315     {
    316       value=XBMInteger(image,hex_digits);
    317       *p++=(unsigned char) value;
    318       if (!padding || ((i+2) % bytes_per_line))
    319         *p++=(unsigned char) (value >> 8);
    320     }When a crafted XBM image file, which claims large image->rows and image->columns but does not contains sufficient backing data, is provided,the
 loop at line 314 would consume huge CPU and memroy 
resources, since there is no EOF (End of File) check inside the loop.It is worth noting that variable bytes_per_line is computed based on image->columns earlier.In our test, we used a machine with Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz, 4 CPU cores and 16GB RAM.This bug casued 100% CPU and up to 4GB RAM consumption.
This process lasted for more than 9 minutes.
Affected version:

Fixed version:

Commit fix:
This bug was discovered by Xiaohei and Wangchu from Alibaba Security Team.


Reproducer: command we was using is     gm convert poc-314.xbm test.jpg

2017-08-24: bug discovered and reported to upstream privately
2017-08-26: upstream released a fix
2017-08-30: CVE assigned

Powered by blists - more mailing lists

Please check out the Open Source Software Security Wiki, which is counterpart to this mailing list.

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.