CVE-2021-39212: Issue when Configuring the ImageMagick Security Policy

Published Sep 13, 2021
·
Updated

ImageMagick is free software delivered as a ready-to-run binary distribution or as source code that you may use, copy, modify, and distribute in both open and proprietary applications. In affected versions and in certain cases, Postscript files could be read and written when specifically excluded by a module policy in policy.xml. ex. <policy domain="module" rights="none" pattern="PS" />. The issue has been resolved in ImageMagick 7.1.0-7 and in 6.9.12-22. Fortunately, in the wild, few users utilize the module policy and instead use the coder policy that is also our workaround recommendation: <policy domain="coder" rights="none" pattern="{PS,EPI,EPS,EPSF,EPSI}" />.

Affected Software

3 affected componentsFixes available
ImageMagick>=6.9.12-0<6.9.12-22
ImageMagick>=7.1.0-0<7.1.0-7
debian/imagemagick
8:6.9.11.60+dfsg-1.3+deb11u48:6.9.11.60+dfsg-1.3+deb11u38:6.9.11.60+dfsg-1.6+deb12u28:6.9.11.60+dfsg-1.6+deb12u18:7.1.1.43+dfsg1-18:7.1.1.47+dfsg1-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/imagemagick to a version that resolves this vulnerability.

    Fixed in 8:6.9.11.60+dfsg-1.3+deb11u4Fixed in 8:6.9.11.60+dfsg-1.3+deb11u3Fixed in 8:6.9.11.60+dfsg-1.6+deb12u2Fixed in 8:6.9.11.60+dfsg-1.6+deb12u1Fixed in 8:7.1.1.43+dfsg1-1Fixed in 8:7.1.1.47+dfsg1-1
  2. Upgrade

    Upgrade ImageMagick to a version that resolves this vulnerability.

    Fixed in 7.1.0-7
  3. Upgrade

    Upgrade ImageMagick to a version that resolves this vulnerability.

    Fixed in 6.9.12-22
  4. Configuration

    As a workaround when using ImageMagick security policies, avoid the affected `module` policy behavior and use the `coder` policy instead: set `<policy domain="coder" rights="none" pattern="{PS,EPI,EPS,EPSF,EPSI}" />` rather than excluding via a `module` policy in `policy.xml`.

    ImageMagick policy.xml module policy exclusion for Postscript = Use the `coder` policy instead of `module` (set rights='none' and pattern as shown)

Event History

Sep 13, 2021
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·06:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Jan 12, 2024
Data Sourced
via Launchpad·12:00 AM
Description
Sep 16, 2024
Data Sourced
via Ubuntu·02:34 AM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

What is CVE-2021-39212?

CVE-2021-39212 is a vulnerability in ImageMagick that allows certain cases of reading and writing Postscript files that should be excluded.

2

What is the severity of CVE-2021-39212?

CVE-2021-39212 has a severity rating of medium, with a CVSS score of 3.6.

3

Which versions of ImageMagick are affected by CVE-2021-39212?

CVE-2021-39212 affects versions up to and including 6.9.12-22 and 7.1.0-7 of ImageMagick.

4

How can I fix CVE-2021-39212?

To fix CVE-2021-39212, update ImageMagick to version 6.9.10.23+dfsg-2.1ubuntu11.9, 8:6.9.11.60+dfsg-1.3ubuntu0.22.10.1, 8:6.9.11.60+dfsg-1.3ubuntu1, 8:6.9.11.60+dfsg-1.3ubuntu0.22.04.3+, or 8:6.9.11.60+dfsg-1.3ubuntu1.

5

Where can I find more information about CVE-2021-39212?

You can find more information about CVE-2021-39212 in the following references: [cve.mitre.org](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-39212), [github.com](https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-qvhr-jj4p-j2qr), [ubuntu.com](https://ubuntu.com/security/notices/USN-5736-1).

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203