Millions Of Web Servers Vulnerable To ImageMagick Attack

US-CERT issues advisory on 0-day flaws found in popular image processing tool.

Dark Reading logo in a gray background | Dark Reading

LAS VEGAS – Interop 2016 -- A popular open-source image processing tool used in content management systems, social media, and other Web servers contains newly discovered vulnerabilities that could allow an attacker to wrest control of those systems.

Researchers yesterday disclosed details of the flaws found in the ImageMagick library of tools --before fully functioning patches were available because there were already exploits circulating.  Meantime, Metasploit modules have been created and are in the public review process.

US-CERT today issued an advisory about the vulnerabilities, and noted that the developers of ImageMagick have released updates to their software, versions 7.0.1-1 and 6.9.3-10. But the research firm that found and studied the flaws says the patches are "incomplete."

Moore and other security experts say the vulnerabilities are noteworthy and potentially serious, but the good news is that there are some configurations that won’t necessarily be at risk. And the image attacks are nowhere near as easy to pull off as many other Web exploits.

“Right now there’s lower-hanging fruit. You don’t need to burn an 0-day,” says Cameron Camp, security researcher at ESET, who will give a presentation on malware here this week. An attacker more easily could scan for other simpler vulnerabilities or exploit an open port, Camp says.

Some Web platforms have filters that content must pass before being sent to the ImageMagick library, so the attack isn’t necessarily lethal for all sites. “The systems most at risk are Web applications that allow users to upload media. This applies to forums, content management systems, image boards, and various social media networks,” Moore says. “Many blogging and hosting platforms also support ImageMagick as a plugin, but most of those require a valid user account before you can upload media.”

ImageMagick is a tool for resizing images uploaded to Web servers. “A PHP function calls ImageMagick to resize photos. If you can impersonate ImageMagick, you have a privileged user situation,” Camp says.

Mail.Ru’s Nikolay Ermishkin is credited with discovering several flaws in ImageMagick, including the CVE-2016-3716 vulnerability that could let an attacker remotely run code on a victim server. The flaw lies in insufficient filtering for a filename such that an attacker could slip malicious code into the file conversion process. 

A second flaw, CVE-2016-3716, described as a “file moving” bug, allows an attacker to move an image file to another file extension in any folder using ImageMagick’s “msl” protocol. “In real life it may be web services written in PHP, which allows to upload raw txt files and process images with ImageMagick,” Mail.Ru wrote in a post today. 

There are a total of five vulnerabilities, which have been dubbed "ImageTragick."

“The less-likely but more dangerous scenarios are systems that automatically process media stored by untrusted users. For example, a photo gallery service that uses ImageMagick to generate thumbnails from user uploads,” Moore says.

Meanwhile, experts recommend verifying all image files before sending them to ImageMagick for formatting, and using a policy file to disable the vulnerable ImageMagick coders. 

About the Author

Kelly Jackson Higgins, Editor-in-Chief, Dark Reading

Kelly Jackson Higgins is the Editor-in-Chief of Dark Reading. She is an award-winning veteran technology and business journalist with more than two decades of experience in reporting and editing for various publications, including Network Computing, Secure Enterprise Magazine, Virginia Business magazine, and other major media properties. Jackson Higgins was recently selected as one of the Top 10 Cybersecurity Journalists in the US, and named as one of Folio's 2019 Top Women in Media. She began her career as a sports writer in the Washington, DC metropolitan area, and earned her BA at William & Mary. Follow her on Twitter @kjhiggins.

Keep up with the latest cybersecurity threats, newly discovered vulnerabilities, data breach information, and emerging trends. Delivered daily or weekly right to your email inbox.

You May Also Like


More Insights