thedude
Well-known member
"There are multiple vulnerabilities in ImageMagick, a package commonly used by web services to process images. One of the vulnerabilities can lead to remote code execution (RCE) if you process user submitted images. The exploit for this vulnerability is being used in the wild."
This will apparently be fixed in ImageMagick versions 7.0.1-1 and 6.9.3-10
ImageMagick's own forum discussion
ImageTragick vulnerability page
Hacker News discussion
To fix this issue on affected versions (older than 7.0.1-1 and 6.9.3-10):
1. SSH into your servers.
2. Type in
What you want to see are the items in bold:
If you don't see the see the bolded items in your output, then here's how we fix it.
Use your favorite editor (nano, pico, vim, vi, etc) to edit the file that was listed in the "Path:" parameter of the output above. So if your Path parameter showed Path: /etc/ImageMagick-6/policy.xml, you would open the file /etc/ImageMagick-6/policy.xml in your favorite editor.
Once opened, scroll to the end of that file and find the closing of the policymap section. It'll be indicated by the following (notice the right leaning slash):
Insert the following directly above the closing policymap tag you found above:
So with the closing tag included, it should look like this:
Save and exit the file.
Re-run the command in step 2 at the top of this post and verify that you're seeing the necessary policies in your output from that command.
This will apparently be fixed in ImageMagick versions 7.0.1-1 and 6.9.3-10
ImageMagick's own forum discussion
ImageTragick vulnerability page
Hacker News discussion
To fix this issue on affected versions (older than 7.0.1-1 and 6.9.3-10):
1. SSH into your servers.
2. Type in
Code:
convert -list policy
What you want to see are the items in bold:
Path: <some-path>/policy.xml
Policy: Unrecognized
rights: None
Policy: Coder
rights: None
pattern: EPHEMERAL
Policy: Coder
rights: None
pattern: HTTPS
Policy: Coder
rights: None
pattern: MVG
Policy: Coder
rights: None
pattern: MSL
Policy: Coder
rights: None
pattern: URL
If you don't see the see the bolded items in your output, then here's how we fix it.
Use your favorite editor (nano, pico, vim, vi, etc) to edit the file that was listed in the "Path:" parameter of the output above. So if your Path parameter showed Path: /etc/ImageMagick-6/policy.xml, you would open the file /etc/ImageMagick-6/policy.xml in your favorite editor.
Once opened, scroll to the end of that file and find the closing of the policymap section. It'll be indicated by the following (notice the right leaning slash):
Code:
</policymap>
Insert the following directly above the closing policymap tag you found above:
Code:
<policy domain="coder" rights="none" pattern="EPHEMERAL" />
<policy domain="coder" rights="none" pattern="HTTPS" />
<policy domain="coder" rights="none" pattern="MVG" />
<policy domain="coder" rights="none" pattern="MSL" />
<policy domain="coder" rights="none" pattern="URL" />
So with the closing tag included, it should look like this:
Code:
<policy domain="coder" rights="none" pattern="EPHEMERAL" />
<policy domain="coder" rights="none" pattern="HTTPS" />
<policy domain="coder" rights="none" pattern="MVG" />
<policy domain="coder" rights="none" pattern="MSL" />
<policy domain="coder" rights="none" pattern="URL" />
</policymap>
Save and exit the file.
Re-run the command in step 2 at the top of this post and verify that you're seeing the necessary policies in your output from that command.