{"id":124102,"date":"2021-06-30T08:00:42","date_gmt":"2021-06-30T15:00:42","guid":{"rendered":"\/blogs\/?p=124102"},"modified":"2024-07-08T01:10:19","modified_gmt":"2024-07-08T08:10:19","slug":"fuzzing-imagemagick-and-digging-deeper-into-cve-2020-27829","status":"publish","type":"post","link":"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/fuzzing-imagemagick-and-digging-deeper-into-cve-2020-27829\/","title":{"rendered":"Fuzzing ImageMagick and Digging Deeper into CVE-2020-27829"},"content":{"rendered":"<h2><strong>Introduction:<\/strong><\/h2>\n<p>ImageMagick is a hugely popular open source software that is used in lot of systems around the world. It is available for the Windows, Linux, MacOS platforms as well as Android and iOS. It is used for editing, creating or converting various digital image formats and supports various formats like PNG, JPEG, WEBP, TIFF, HEIC and PDF, among others.<\/p>\n<p>Google OSS Fuzz and other threat researchers have made ImageMagick the frequent focus of fuzzing, an extremely popular technique used by security researchers to discover potential zero-day vulnerabilities in open, as well as closed source software. This research has resulted in various vulnerability discoveries that must be addressed on a regular basis by its maintainers. Despite the efforts of many to expose such vulnerabilities, recent fuzzing research from McAfee has exposed new vulnerabilities involving processing of multiple image formats, in various open source and closed source software and libraries including ImageMagick and Windows GDI+.<\/p>\n<h3><strong>Fuzzing ImageMagick:<\/strong><\/h3>\n<p>Fuzzing open source libraries has been covered in a detailed blog <a href=\"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/vulnerability-discovery-in-open-source-libraries-part-1-tools-of-the-trade\/\" target=\"_blank\" rel=\"noopener\">\u201cVulnerability Discovery in Open Source Libraries Part 1: Tools of the Trade\u201d<\/a> last year. Fuzzing ImageMagick is very well documented, so we will be quickly covering the process in this blog post and will focus on the root cause analysis of the issue we have found.<\/p>\n<h3><strong>Compiling ImageMagick with AFL:<\/strong><\/h3>\n<p>ImageMagick has lot of configuration options which we can see by running following command:<\/p>\n<table style=\"border-collapse: collapse; width: 16.0211%; height: 24px;\">\n<tbody>\n<tr>\n<td style=\"width: 100%;\"><strong>$.\/configure \u2013help<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>We can customize various parameters as per our needs. To compile and install ImageMagick with AFL for our case, we can use following commands:<\/p>\n<table style=\"border-collapse: collapse; width: 69.3441%; height: 144px;\">\n<tbody>\n<tr>\n<td style=\"width: 100%;\"><strong>$CC=afl-gcc CXX=afl=g++ CFLAGS=&#8221;-ggdb -O0 -fsanitize=address,undefined -fno-omit-frame-pointer&#8221; LDFLAGS=&#8221;-ggdb -fsanitize=address,undefined -fno-omit-frame-pointer&#8221; .\/configure<\/strong><\/p>\n<p><strong>$<\/strong> <strong>make -j$(nproc)<\/strong><\/p>\n<p><strong>$sudo make install<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>This will compile and install ImageMagick with AFL instrumentation. The binary we will be fuzzing is \u201c<strong>magick<\/strong>\u201d, also known as \u201cmagick tool\u201d. It has various options, but we will be using its image conversion feature to convert our image from one format to another.<\/p>\n<p>A simple command would be include the following:<\/p>\n<table style=\"border-collapse: collapse; width: 26.9366%; height: 28px;\">\n<tbody>\n<tr>\n<td style=\"width: 100%;\"><strong>$ magick &lt;input file&gt; &lt;output file&gt;<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>This command will convert an input file to an output file format. We will be fuzzing this with AFL.<\/p>\n<h3><strong>Collecting Corpus:<\/strong><\/h3>\n<p>Before we start fuzzing, we need to have a good input corpus. One way of collecting corpus is to search on Google or GitHub. We can also use existing test corpus from various software. A good test corpus is available on the \u00a0AFL site here: <a href=\"https:\/\/lcamtuf.coredump.cx\/afl\/demo\/\" target=\"_blank\" rel=\"noopener\">https:\/\/lcamtuf.coredump.cx\/afl\/demo\/<\/a><\/p>\n<h3><strong>Minimizing Corpus:<\/strong><\/h3>\n<p>Corpus collection is one thing, but we also need to minimize the corpus. The way AFL works is that it will instrument each basic block so that it can trace the program execution path. It maintains a shared memory as a bitmap and it uses an algorithm to check new block hits. If a new block hit has been found, it will save this information to bitmap.<\/p>\n<p>Now it may be possible that more than one input file from the corpus can trigger the same path, as we have collected sample files from various sources, we don\u2019t have any information on what paths they will trigger at the runtime. If we use this corpus without removing such files, then we end up wasting time and CPU cycles. We need to avoid that.<\/p>\n<p>Interestingly AFL offers a utility called \u201c<strong>afl-cmin<\/strong>\u201d which we can use to minimize our test corpus. This is a recommended thing to do before you start any fuzzing campaign. We can run this as follows:<\/p>\n<table style=\"border-collapse: collapse; width: 56.7782%;\">\n<tbody>\n<tr>\n<td style=\"width: 100%;\"><strong>$afl-cmin -i &lt;input directory&gt; -o &lt;output directory&gt; &#8212; magick @@ \/dev\/null<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>This command will minimize the input corpus and will keep only those files which trigger unique paths.<\/p>\n<h3><strong>Running Fuzzers:<\/strong><\/h3>\n<p>After we have minimized corpus, we can start fuzzing. To fuzz we need to use following command:<\/p>\n<table style=\"border-collapse: collapse; width: 59.9472%;\">\n<tbody>\n<tr>\n<td style=\"width: 100%;\"><strong>$afl-fuzz -i &lt;mincorpus directory&gt; -o &lt;output directory&gt; &#8212; magick @@ \/dev\/null<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>This will only run a single instance of AFL utilizing a single core. In case we have multicore processors, we can run multiple instances of AFL, with one Master and n number of Slaves. Where n is the available CPU cores.<\/p>\n<p>To check available CPU cores, we can use this command:<\/p>\n<table style=\"border-collapse: collapse; width: 7.39437%;\">\n<tbody>\n<tr>\n<td style=\"width: 100%;\"><strong>$nproc<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>This will give us the number of CPU cores (depending on the system) as follows:<\/p>\n<p>In this case there are eight cores. So, we can run one Master and up to seven Slaves.<\/p>\n<p>To run master instances, we can use following command:<\/p>\n<table style=\"border-collapse: collapse; width: 67.7817%;\">\n<tbody>\n<tr>\n<td style=\"width: 100%;\"><strong>$afl-fuzz -M Master -i &lt;mincorpus directory&gt; -o &lt;output directory&gt; &#8212; magick @@ \/dev\/null<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>We can run slave instances using following command:<\/p>\n<table style=\"border-collapse: collapse; width: 66.9014%;\">\n<tbody>\n<tr>\n<td style=\"width: 100%;\"><strong>$afl-fuzz -S Slave1 -i &lt;mincorpus directory&gt; -o &lt;output directory&gt; &#8212; magick @@ \/dev\/null<\/strong><\/p>\n<p><strong>$afl-fuzz -S Slave2 -i &lt;mincorpus directory&gt; -o &lt;output directory&gt; &#8212; magick @@ \/dev\/null<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The same can be done for each slave. We just need to use an argument -S and can use any name like slave1, slave2, etc.<\/p>\n<h3><strong>Results:<\/strong><\/h3>\n<p>Within a few hours of beginning this Fuzzing campaign, we found one crash related to an out of bound read inside a heap memory. We have reported this issue to ImageMagick, and they were very prompt in fixing it with a patch the very next day. ImageMagick has release a new build with version: 7.0.46 to fix this issue. This issue was assigned <strong>CVE-2020-27829<\/strong>.<\/p>\n<h3><strong>Analyzing CVE-2020-27829:<\/strong><\/h3>\n<p>On checking the POC file, we found that it was a TIFF file.<\/p>\n<p>When we open this file with ImageMagick with following command:<\/p>\n<table style=\"border-collapse: collapse; width: 21.831%;\">\n<tbody>\n<tr>\n<td style=\"width: 100%;\"><strong>$magick poc.tif \/dev\/null<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>As a result, we see a crash like below:<\/p>\n<p>As is clear from the above log, the program was trying to read 1 byte past allocated heap buffer and therefore ASAN caused this crash. This can atleast lead to a <em>\u00a0ImageMagick crash<\/em> on the systems running vulnerable version of ImageMagick.<\/p>\n<h3><strong>Understanding TIFF file format:<\/strong><\/h3>\n<p>Before we start debugging this issue to find a root cause, it is necessary to understand the TIFF file format. Its specification is very well described here: <a href=\"http:\/\/paulbourke.net\/dataformats\/tiff\/tiff_summary.pdf\" target=\"_blank\" rel=\"noopener\">http:\/\/paulbourke.net\/dataformats\/tiff\/tiff_summary.pdf<\/a>.<\/p>\n<p>In short, a TIFF file has three parts:<\/p>\n<ol>\n<li><strong>Image File Header (IFH)<\/strong> \u2013 Contains information such as file identifier, version, offset of IFD.<\/li>\n<li><strong>Image File Directory (IFD)<\/strong> \u2013 Contains information on the height, width, and depth of the image, the number of colour planes, etc. It also contains various TAGs like <strong>colormap<\/strong>, <strong>page number<\/strong>, <strong>BitPerSample<\/strong>, <strong>FillOrder,<\/strong><\/li>\n<li><strong>Bitmap data<\/strong> \u2013 Contains various image data like strips, tiles, etc.<\/li>\n<\/ol>\n<p>We can <strong>tiffinfo<\/strong> utility from <strong>libtiff<\/strong> to gather various information about the POC file. This allows us to see the following information with <strong>tiffinfo<\/strong> like <strong>width<\/strong>, <strong>height<\/strong>, <strong>sample per pixel<\/strong>, <strong>row per strip<\/strong> etc.:<\/p>\n<p>There are a few things to note here:<\/p>\n<table style=\"border-collapse: collapse; width: 38.4683%;\">\n<tbody>\n<tr>\n<td style=\"width: 100%;\">TIFF Dir offset is: <strong>0xa0<\/strong><\/p>\n<p>Image width is: <strong>3<\/strong> and length is: <strong>32<\/strong><\/p>\n<p>Bits per sample is: <strong>9<\/strong><\/p>\n<p>Sample per pixel is: <strong>3<\/strong><\/p>\n<p>Rows per strip is: <strong>1024<\/strong><\/p>\n<p>Planer configuration is: <strong>single image plane<\/strong>.<\/p>\n<p>We will be using this data moving forward in this post.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><strong>Debugging the issue:<\/strong><\/h3>\n<p>As we can see in the crash log, program was crashing at function \u201cPushQuantumPixel\u201d in the following location in quantum-import.c line 256:<\/p>\n<p>&nbsp;<\/p>\n<p>On checking \u201cPushQuantumPixel\u201d function in \u201cMagickCore\/quantum-import.c\u201d we can see the following code at line #256 where program is crashing:<\/p>\n<p>We can see following:<\/p>\n<ul>\n<li>\u201cpixels\u201d seems to be a character array<\/li>\n<li>inside a for loop its value is being read and it is being assigned to <strong>quantum_info-&gt;state.pixel<\/strong><\/li>\n<li>its address is increased by one in each loop iteration<\/li>\n<\/ul>\n<p>The program is crashing at this location while reading the value of \u201cpixels\u201d which means that value is out of bound from the allocated heap memory.<\/p>\n<p>Now we need to figure out following:<\/p>\n<ol>\n<li>What is \u201cpixels\u201d and what data it contains?<\/li>\n<li>Why it is crashing?<\/li>\n<li>How this was fixed?<\/li>\n<\/ol>\n<h3><strong>Finding root cause:<\/strong><\/h3>\n<p>To start with, we can check \u201cReadTIFFImage\u201d function in coders\/tiff.c file and see that it allocates memory using a \u201cAcquireQuantumMemory\u201d function call, which appears as per the documentation mentioned here:<\/p>\n<p><a href=\"https:\/\/imagemagick.org\/api\/memory.php\" target=\"_blank\" rel=\"noopener\">https:\/\/imagemagick.org\/api\/memory.php<\/a>:<\/p>\n<p>\u201cReturns a pointer to a block of memory at least count * quantum bytes suitably aligned for any use.<\/p>\n<p>The format of the \u201c<strong>AcquireQuantumMemory\u201d<\/strong> method is:<\/p>\n<p><strong>void *AcquireQuantumMemory(const size_t count,const size_t quantum)<\/strong><\/p>\n<p>A description of each parameter follows:<\/p>\n<p><strong>count<\/strong><\/p>\n<p>the number of objects to allocate contiguously.<\/p>\n<p><strong>quantum<\/strong><\/p>\n<p>the size (in bytes) of each object. \u201c<\/p>\n<p>In this case two parameters passed to this function are <strong>\u201cextent\u201d<\/strong> and <strong>\u201csizeof(*strip_pixels)\u201d<\/strong><\/p>\n<p>We can see that <strong>\u201cextent\u201d<\/strong> is calculated as following in the code below:<\/p>\n<p>There is a function TIFFStripSize(tiff) which returns size for a strip of data as mentioned in libtiff documentation here:<\/p>\n<p><a href=\"http:\/\/www.libtiff.org\/man\/TIFFstrip.3t.html\" target=\"_blank\" rel=\"noopener\">http:\/\/www.libtiff.org\/man\/TIFFstrip.3t.html<\/a><\/p>\n<p>In our case, it returns <strong>224<\/strong> and we can also see that in the code mentioned above,\u00a0 \u201c<strong>image-&gt;columns * sizeof(uint64)\u201d<\/strong> is also added to extent, which results in <strong>24<\/strong> added to extent, so extent value becomes <strong>248<\/strong>.<\/p>\n<p>So, this extent value of 248 and sizeof(*strip_pixels) which is 1 is passed to \u201c<strong>AcquireQuantumMemory\u201d<\/strong> function and total memory of <strong>248<\/strong> bytes get allocated.<\/p>\n<p>This is how memory is allocated.<\/p>\n<p><strong>\u201cStrip_pixel<\/strong>\u201d is pointer to newly allocated memory.<\/p>\n<p>Note that this is <strong>248<\/strong> bytes of newly allocated memory. Since we are using ASAN, each byte will contain \u201c0xbe\u201d which is default for newly allocated memory by ASAN:<\/p>\n<p><a href=\"https:\/\/github.com\/llvm-mirror\/compiler-rt\/blob\/master\/lib\/asan\/asan_flags.inc\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/llvm-mirror\/compiler-rt\/blob\/master\/lib\/asan\/asan_flags.inc<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>The memory start location is 0x6110000002c0 and the end location is 0x6110000003b7, which is 248 bytes total.<\/p>\n<p>This memory is set to 0 by a \u201c<strong>memset\u201d<\/strong> call and this is assigned to a variable <strong>\u201cp\u201d,<\/strong> as mentioned in below image. Please also note that <strong>\u201cp\u201d<\/strong> will be used as a pointer to traverse this memory location going forward in the program:<\/p>\n<p>&nbsp;<\/p>\n<p>Later on we see that there is a call to \u201c<strong>TIFFReadEncodedPixels\u201d<\/strong> which reads strip data from TIFF file and stores it into newly allocated buffer \u201c<strong>strip_pixels<\/strong>\u201d of <strong>248<\/strong> bytes (documentation here: <a href=\"http:\/\/www.libtiff.org\/man\/TIFFReadEncodedStrip.3t.html\">http:\/\/www.libtiff.org\/man\/TIFFReadEncodedStrip.3t.html<\/a>):<\/p>\n<p>To understand what this TIFF file data is, we need to again refer to TIFF file structure. We can see that there is a tag called \u201c<strong>StripOffsets\u201d<\/strong> and its value is 8, which specifies the offset of strip data inside TIFF file:<\/p>\n<p>&nbsp;<\/p>\n<p>We see the following when we check data at <strong>offset 8<\/strong> in the TIFF file:<\/p>\n<p>&nbsp;<\/p>\n<p>We see the following when we print the data in \u201c<strong>strip_pixels<\/strong>\u201d (note that it is in <strong>little endian<\/strong> format):<\/p>\n<p>So <strong>\u201cstrip_pixels\u201d<\/strong> is the actual data from the TIFF file from <strong>offset 8<\/strong>. This will be traversed through pointer <strong>\u201cp\u201d.<\/strong><\/p>\n<p>Inside \u201c<strong>ReadTIFFImage\u201d<\/strong> function there are two nested for loops.<\/p>\n<ul>\n<li>The first <strong>\u201cfor loop\u201d<\/strong> is responsible for iterating for \u201c<strong>samples_per_pixel\u201d<\/strong> time which is <strong>3<\/strong>.<\/li>\n<li>The second <strong>\u201cfor loop\u201d<\/strong> is responsible for iterating the pixel data for \u201c<strong>image-&gt;rows<\/strong>\u201d times, which is <strong>32<\/strong>. This second loop will be executed for <strong>32<\/strong> times or number of rows in the image irrespective of <strong>allocated buffer size<\/strong> .<\/li>\n<li>Inside this second for loop, we can see something like this:<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li>We can notice that <strong>\u201cImportQuantumPixel\u201d<\/strong> function uses the <strong>\u201cp\u201d<\/strong> pointer to read the data from <strong>\u201cstrip_pixels\u201d<\/strong> and after each call to \u201c<strong>ImportQuantumPixel<\/strong>\u201d, value of <strong>\u201cp\u201d<\/strong> will be increased by <strong>\u201cstride\u201d<\/strong>.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>Here \u201c<strong>stride<\/strong>\u201d is calculated by calling function \u201c<strong>TIFFVStripSize()<\/strong>\u201d function which as per documentation returns the number of bytes in a strip with\u00a0<em>nrows<\/em>\u00a0rows of data.\u00a0 In this case it is <strong>14<\/strong>. So, every time pointer <strong>\u201cp\u201d<\/strong> is incremented by \u201c<strong>14\u201d<\/strong> or \u201c<strong>0xE<\/strong>\u201d inside the <strong>second for loop<\/strong>.<\/p>\n<p>If we print the <strong>image<\/strong> structure which is passed to \u201c<strong>ImportQuantumPixels<\/strong>\u201d function as parameter, we can see following:<\/p>\n<p>Here we can notice that the <strong>columns<\/strong> value is <strong>3<\/strong>, the <strong>rows<\/strong> value is <strong>32<\/strong> and <strong>depth<\/strong> is <strong>9<\/strong>. If we check in the POC TIFF file, this has been taken from <strong>ImageWidth<\/strong> and <strong>ImageLength<\/strong> and <strong>BitsPerSample<\/strong> value:<\/p>\n<p>Ultimately, control reaches to \u201c<strong>ImportRGBQuantum<\/strong>\u201d and then to the \u201c<strong>PushQuantumPixel<\/strong>\u201d function and one of the arguments to this function is the pixels data which is pointed by <strong>\u201cp\u201d<\/strong>. Remember that this points to the memory address which was previously allocated using the \u201c<strong>AcquireQuantumMemory<\/strong>\u201d function, and that its length is 248 byte and every time value of \u201cp\u201d is increased by 14.<\/p>\n<p>The<strong> \u201cPushQuantumPixel\u201d<\/strong> function is used to read pixel data from <strong>\u201cp\u201d<\/strong> into the internal pixel data storage of <strong>ImageMagick<\/strong>. There is a for loop which is responsible for reading data from the provided pixels array of 248 bytes into a structure \u201c<strong>quantum_Info<\/strong>\u201d. This loop reads data from pixels incrementally and saves it in the <strong>\u201cquantum_info-&gt;state.pixels\u201d<\/strong> field.<\/p>\n<p>&nbsp;<\/p>\n<p>The <strong>root cause<\/strong> here is that there are no proper bounds checks and the program tries to read data beyond the allocated buffer size on the heap, while reading the strip data inside a <strong>for loop<\/strong>.<\/p>\n<p>This causes a crash in ImageMagick as we can see below:<\/p>\n<h3><\/h3>\n<h3><strong>Root cause<\/strong><\/h3>\n<p>Therefore, to summarize, the program crashes because:<\/p>\n<ol>\n<li>The program allocates 248 bytes of memory to process strip data for image, a pointer <strong>\u201cp\u201d<\/strong> points to this memory.<\/li>\n<li>Inside a for loop this pointer is increased by \u201c14\u201d or \u201c0xE\u201d for number of rows in the image, which in this case is 32.<\/li>\n<li>Based on this calculation, 32*14=448 bytes or more amount of memory is required but only 248 in actual memory were allocated.<\/li>\n<li>The program tries to read data assuming total memory is of 448+ bytes, but the fact that only 248 bytes are available causes an Out of Bound memory read issue.<\/li>\n<\/ol>\n<h3><strong>How it was fixed?<\/strong><\/h3>\n<p>If we check at the patch diff, we can see that the following changes were made to fix this issue:<\/p>\n<p>Here the 2<sup>nd<\/sup> argument to \u201c<strong>AcquireQuantumMemory<\/strong>\u201d is multiplied by <strong>2<\/strong> thus increasing the total amount of memory and preventing this Out of Bound read issue from heap memory. The total memory allocated is <strong>496<\/strong> bytes, <strong>248*2=496<\/strong> bytes, as we can see below:<\/p>\n<h3><strong>Another issue with the fix:<\/strong><\/h3>\n<p>A new version of ImageMagick 7.0.46 was released to fix this issue. While the patch fixes the memory allocation issue, if we check the code below, we can see that there was a call to <strong>memset<\/strong> which didn\u2019t set the proper memory size to zero.<\/p>\n<p>Memory was allocated <strong>extent*2*sizeof(*strip_pixels)<\/strong> but in this <strong>memset<\/strong> to <strong>0<\/strong> was only done for <strong>extent*sizeof(*strip_pixels).<\/strong> This means half of the memory was set to 0 and rest contained <strong>0xbebebebe,<\/strong> which is by default for ASAN new memory allocation.<\/p>\n<p>This has since been fixed in subsequent releases of ImageMagick by using <strong>extent=2*TIFFStripSize(tiff);<\/strong> in the following patch:<\/p>\n<p><a href=\"https:\/\/github.com\/ImageMagick\/ImageMagick\/commit\/a5b64ccc422615264287028fe6bea8a131043b59#diff-0a5eef63b187504ff513056aa8fd6a7f5c1f57b6d2577a75cff428c0c7530978\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/ImageMagick\/ImageMagick\/commit\/a5b64ccc422615264287028fe6bea8a131043b59#diff-0a5eef63b187504ff513056aa8fd6a7f5c1f57b6d2577a75cff428c0c7530978<\/a><\/p>\n<h3><strong>Conclusion:<\/strong><\/h3>\n<p>Processing various image files requires deep understanding of various file formats and thus it is possible that something may not be exactly implemented or missed. This can lead to various vulnerabilities in such image processing software. Some of this vulnerability can lead to DoS and some can lead to remote code execution affecting every installation of such popular software.<\/p>\n<p>Fuzzing plays an important role in finding vulnerabilities often missed by developers and during testing. We at McAfee constantly fuzz various closed source as well as open source software to help secure them. We work very closely with various vendors and do responsible disclosure. This shows McAfee\u2019s commitment towards securing the software and protecting our customers from various threats.<\/p>\n<p>We will continue to fuzz various software and work with vendors to help mitigate risk arriving from such threats.<\/p>\n<p>We would like to thank and appreciate ImageMagick team for quickly resolving this issue within 24 hours and releasing a new version to fix this issue.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction: ImageMagick is a hugely popular open source software that is used in lot of systems around the world. It&#8230;<\/p>\n","protected":false},"author":612,"featured_media":117895,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[442],"tags":[],"coauthors":[2095],"class_list":["post-124102","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mcafee-labs"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Fuzzing ImageMagick and Digging Deeper into CVE-2020-27829 | McAfee Blog<\/title>\n<meta name=\"description\" content=\"Introduction: ImageMagick is a hugely popular open source software that is used in lot of systems around the world. It is available for the Windows,\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Fuzzing ImageMagick and Digging Deeper into CVE-2020-27829 | McAfee Blog\" \/>\n<meta property=\"og:description\" content=\"Introduction: ImageMagick is a hugely popular open source software that is used in lot of systems around the world. It is available for the Windows,\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/fuzzing-imagemagick-and-digging-deeper-into-cve-2020-27829\/\" \/>\n<meta property=\"og:site_name\" content=\"McAfee Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/McAfee\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-06-30T15:00:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-08T08:10:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2021\/03\/GoziBanker_TW-e1615823848762.png\" \/>\n\t<meta property=\"og:image:width\" content=\"500\" \/>\n\t<meta property=\"og:image:height\" content=\"281\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Hardik Shah\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@hardik05\" \/>\n<meta name=\"twitter:site\" content=\"@McAfee\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Hardik Shah\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/fuzzing-imagemagick-and-digging-deeper-into-cve-2020-27829\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/fuzzing-imagemagick-and-digging-deeper-into-cve-2020-27829\/\"},\"author\":{\"name\":\"Hardik Shah\",\"@id\":\"https:\/\/www.mcafee.com\/blogs\/#\/schema\/person\/99cb905e9b4051dfea96a7752dea4342\"},\"headline\":\"Fuzzing ImageMagick and Digging Deeper into CVE-2020-27829\",\"datePublished\":\"2021-06-30T15:00:42+00:00\",\"dateModified\":\"2024-07-08T08:10:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/fuzzing-imagemagick-and-digging-deeper-into-cve-2020-27829\/\"},\"wordCount\":2606,\"publisher\":{\"@id\":\"https:\/\/www.mcafee.com\/blogs\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/fuzzing-imagemagick-and-digging-deeper-into-cve-2020-27829\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2021\/03\/GoziBanker_TW-e1615823848762.png\",\"articleSection\":[\"McAfee Labs\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/fuzzing-imagemagick-and-digging-deeper-into-cve-2020-27829\/\",\"url\":\"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/fuzzing-imagemagick-and-digging-deeper-into-cve-2020-27829\/\",\"name\":\"Fuzzing ImageMagick and Digging Deeper into CVE-2020-27829 | McAfee Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.mcafee.com\/blogs\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/fuzzing-imagemagick-and-digging-deeper-into-cve-2020-27829\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/fuzzing-imagemagick-and-digging-deeper-into-cve-2020-27829\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2021\/03\/GoziBanker_TW-e1615823848762.png\",\"datePublished\":\"2021-06-30T15:00:42+00:00\",\"dateModified\":\"2024-07-08T08:10:19+00:00\",\"description\":\"Introduction: ImageMagick is a hugely popular open source software that is used in lot of systems around the world. It is available for the Windows,\",\"breadcrumb\":{\"@id\":\"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/fuzzing-imagemagick-and-digging-deeper-into-cve-2020-27829\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/fuzzing-imagemagick-and-digging-deeper-into-cve-2020-27829\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/fuzzing-imagemagick-and-digging-deeper-into-cve-2020-27829\/#primaryimage\",\"url\":\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2021\/03\/GoziBanker_TW-e1615823848762.png\",\"contentUrl\":\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2021\/03\/GoziBanker_TW-e1615823848762.png\",\"width\":500,\"height\":281},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/fuzzing-imagemagick-and-digging-deeper-into-cve-2020-27829\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\/\/www.mcafee.com\/blogs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Other Blogs\",\"item\":\"https:\/\/www.mcafee.com\/blogs\/other-blogs\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"McAfee Labs\",\"item\":\"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Fuzzing ImageMagick and Digging Deeper into CVE-2020-27829\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.mcafee.com\/blogs\/#website\",\"url\":\"https:\/\/www.mcafee.com\/blogs\/\",\"name\":\"McAfee Blog\",\"description\":\"Internet Security News\",\"publisher\":{\"@id\":\"https:\/\/www.mcafee.com\/blogs\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.mcafee.com\/blogs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.mcafee.com\/blogs\/#organization\",\"name\":\"McAfee\",\"url\":\"https:\/\/www.mcafee.com\/blogs\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.mcafee.com\/blogs\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/02\/mcafee-logo.png\",\"contentUrl\":\"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/02\/mcafee-logo.png\",\"width\":1286,\"height\":336,\"caption\":\"McAfee\"},\"image\":{\"@id\":\"https:\/\/www.mcafee.com\/blogs\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/McAfee\/\",\"https:\/\/x.com\/McAfee\",\"https:\/\/www.linkedin.com\/company\/mcafee\/\",\"https:\/\/www.youtube.com\/McAfee\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.mcafee.com\/blogs\/#\/schema\/person\/99cb905e9b4051dfea96a7752dea4342\",\"name\":\"Hardik Shah\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.mcafee.com\/blogs\/#\/schema\/person\/image\/b151596c8b1a8dc9b25ec3b19ccfd8c0\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2b87a13b8b83a589e5494d7db597ad6a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2b87a13b8b83a589e5494d7db597ad6a?s=96&d=mm&r=g\",\"caption\":\"Hardik Shah\"},\"description\":\"Hardik Shah, a Senior Research Engineer in McAfee Labs, is an experienced security researcher and technology evangelist. He has extensive experience with exploits, malware analysis, and various IPS engines. Shah enjoys figuring out ways to protect customers from the latest threats. Prior to McAfee, he worked with the IPS research team at Symantec. You can follow him on twitter at @hardik05\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/hardik05\/\",\"https:\/\/x.com\/hardik05\"],\"url\":\"https:\/\/www.mcafee.com\/blogs\/author\/hardik-shah\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Fuzzing ImageMagick and Digging Deeper into CVE-2020-27829 | McAfee Blog","description":"Introduction: ImageMagick is a hugely popular open source software that is used in lot of systems around the world. It is available for the Windows,","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"Fuzzing ImageMagick and Digging Deeper into CVE-2020-27829 | McAfee Blog","og_description":"Introduction: ImageMagick is a hugely popular open source software that is used in lot of systems around the world. It is available for the Windows,","og_url":"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/fuzzing-imagemagick-and-digging-deeper-into-cve-2020-27829\/","og_site_name":"McAfee Blog","article_publisher":"https:\/\/www.facebook.com\/McAfee\/","article_published_time":"2021-06-30T15:00:42+00:00","article_modified_time":"2024-07-08T08:10:19+00:00","og_image":[{"width":500,"height":281,"url":"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2021\/03\/GoziBanker_TW-e1615823848762.png","type":"image\/png"}],"author":"Hardik Shah","twitter_card":"summary_large_image","twitter_creator":"@hardik05","twitter_site":"@McAfee","twitter_misc":{"Written by":"Hardik Shah","Est. reading time":"14 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/fuzzing-imagemagick-and-digging-deeper-into-cve-2020-27829\/#article","isPartOf":{"@id":"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/fuzzing-imagemagick-and-digging-deeper-into-cve-2020-27829\/"},"author":{"name":"Hardik Shah","@id":"https:\/\/www.mcafee.com\/blogs\/#\/schema\/person\/99cb905e9b4051dfea96a7752dea4342"},"headline":"Fuzzing ImageMagick and Digging Deeper into CVE-2020-27829","datePublished":"2021-06-30T15:00:42+00:00","dateModified":"2024-07-08T08:10:19+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/fuzzing-imagemagick-and-digging-deeper-into-cve-2020-27829\/"},"wordCount":2606,"publisher":{"@id":"https:\/\/www.mcafee.com\/blogs\/#organization"},"image":{"@id":"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/fuzzing-imagemagick-and-digging-deeper-into-cve-2020-27829\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2021\/03\/GoziBanker_TW-e1615823848762.png","articleSection":["McAfee Labs"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/fuzzing-imagemagick-and-digging-deeper-into-cve-2020-27829\/","url":"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/fuzzing-imagemagick-and-digging-deeper-into-cve-2020-27829\/","name":"Fuzzing ImageMagick and Digging Deeper into CVE-2020-27829 | McAfee Blog","isPartOf":{"@id":"https:\/\/www.mcafee.com\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/fuzzing-imagemagick-and-digging-deeper-into-cve-2020-27829\/#primaryimage"},"image":{"@id":"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/fuzzing-imagemagick-and-digging-deeper-into-cve-2020-27829\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2021\/03\/GoziBanker_TW-e1615823848762.png","datePublished":"2021-06-30T15:00:42+00:00","dateModified":"2024-07-08T08:10:19+00:00","description":"Introduction: ImageMagick is a hugely popular open source software that is used in lot of systems around the world. It is available for the Windows,","breadcrumb":{"@id":"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/fuzzing-imagemagick-and-digging-deeper-into-cve-2020-27829\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/fuzzing-imagemagick-and-digging-deeper-into-cve-2020-27829\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/fuzzing-imagemagick-and-digging-deeper-into-cve-2020-27829\/#primaryimage","url":"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2021\/03\/GoziBanker_TW-e1615823848762.png","contentUrl":"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2021\/03\/GoziBanker_TW-e1615823848762.png","width":500,"height":281},{"@type":"BreadcrumbList","@id":"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/fuzzing-imagemagick-and-digging-deeper-into-cve-2020-27829\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/www.mcafee.com\/blogs\/"},{"@type":"ListItem","position":2,"name":"Other Blogs","item":"https:\/\/www.mcafee.com\/blogs\/other-blogs\/"},{"@type":"ListItem","position":3,"name":"McAfee Labs","item":"https:\/\/www.mcafee.com\/blogs\/other-blogs\/mcafee-labs\/"},{"@type":"ListItem","position":4,"name":"Fuzzing ImageMagick and Digging Deeper into CVE-2020-27829"}]},{"@type":"WebSite","@id":"https:\/\/www.mcafee.com\/blogs\/#website","url":"https:\/\/www.mcafee.com\/blogs\/","name":"McAfee Blog","description":"Internet Security News","publisher":{"@id":"https:\/\/www.mcafee.com\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mcafee.com\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.mcafee.com\/blogs\/#organization","name":"McAfee","url":"https:\/\/www.mcafee.com\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mcafee.com\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/02\/mcafee-logo.png","contentUrl":"https:\/\/www.mcafee.com\/blogs\/wp-content\/uploads\/2023\/02\/mcafee-logo.png","width":1286,"height":336,"caption":"McAfee"},"image":{"@id":"https:\/\/www.mcafee.com\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/McAfee\/","https:\/\/x.com\/McAfee","https:\/\/www.linkedin.com\/company\/mcafee\/","https:\/\/www.youtube.com\/McAfee"]},{"@type":"Person","@id":"https:\/\/www.mcafee.com\/blogs\/#\/schema\/person\/99cb905e9b4051dfea96a7752dea4342","name":"Hardik Shah","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mcafee.com\/blogs\/#\/schema\/person\/image\/b151596c8b1a8dc9b25ec3b19ccfd8c0","url":"https:\/\/secure.gravatar.com\/avatar\/2b87a13b8b83a589e5494d7db597ad6a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2b87a13b8b83a589e5494d7db597ad6a?s=96&d=mm&r=g","caption":"Hardik Shah"},"description":"Hardik Shah, a Senior Research Engineer in McAfee Labs, is an experienced security researcher and technology evangelist. He has extensive experience with exploits, malware analysis, and various IPS engines. Shah enjoys figuring out ways to protect customers from the latest threats. Prior to McAfee, he worked with the IPS research team at Symantec. You can follow him on twitter at @hardik05","sameAs":["https:\/\/www.linkedin.com\/in\/hardik05\/","https:\/\/x.com\/hardik05"],"url":"https:\/\/www.mcafee.com\/blogs\/author\/hardik-shah\/"}]}},"_links":{"self":[{"href":"https:\/\/www.mcafee.com\/blogs\/wp-json\/wp\/v2\/posts\/124102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mcafee.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mcafee.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mcafee.com\/blogs\/wp-json\/wp\/v2\/users\/612"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mcafee.com\/blogs\/wp-json\/wp\/v2\/comments?post=124102"}],"version-history":[{"count":3,"href":"https:\/\/www.mcafee.com\/blogs\/wp-json\/wp\/v2\/posts\/124102\/revisions"}],"predecessor-version":[{"id":196155,"href":"https:\/\/www.mcafee.com\/blogs\/wp-json\/wp\/v2\/posts\/124102\/revisions\/196155"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mcafee.com\/blogs\/wp-json\/wp\/v2\/media\/117895"}],"wp:attachment":[{"href":"https:\/\/www.mcafee.com\/blogs\/wp-json\/wp\/v2\/media?parent=124102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mcafee.com\/blogs\/wp-json\/wp\/v2\/categories?post=124102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mcafee.com\/blogs\/wp-json\/wp\/v2\/tags?post=124102"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.mcafee.com\/blogs\/wp-json\/wp\/v2\/coauthors?post=124102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}