CVE-2021-39212Issue when Configuring the ImageMagick Security Policy
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}" />.
What to do
Fixed builds are available from Alpine, Debian, Ubuntu: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 22.04 | imagemagick | Fix pending | 8:6.9.11.60+dfsg-1.3ubuntu0.22.04.1+esm1 (Ubuntu Pro) | UBUNTU-CVE-2021-39212 |
| Ubuntu 20.04 | imagemagick | Fixed | 8:6.9.10.23+dfsg-2.1ubuntu11.9 | UBUNTU-CVE-2021-39212 |
| Ubuntu 16.04 | imagemagick | Fix pending | ||
| Debian 14 | imagemagick | Fixed | 8:6.9.11.60+dfsg-1.5 | DEBIAN-CVE-2021-39212 |
| Debian 13 | imagemagick | Fixed | 8:6.9.11.60+dfsg-1.5 | DEBIAN-CVE-2021-39212 |
| Debian 12 | imagemagick | Fixed | 8:6.9.11.60+dfsg-1.5 | DEBIAN-CVE-2021-39212 |
| Red Hat Enterprise Linux 7 | ImageMagick | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | ImageMagick-c++ | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | ImageMagick-c++-devel | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | ImageMagick-devel | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | ImageMagick-doc | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | ImageMagick-perl | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | ImageMagick | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | ImageMagick-c++ | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | ImageMagick-c++-devel | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | ImageMagick-devel | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | ImageMagick-doc | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | ImageMagick-perl | Will not fix Out of support scope | ||
| Alpine Linux 3.24 | imagemagick | Fixed | 7.1.0.10-r0 | ALPINE-CVE-2021-39212 |
| Alpine Linux 3.23 | imagemagick | Fixed | 7.1.0.10-r0 | ALPINE-CVE-2021-39212 |
| Alpine Linux 3.22 | imagemagick | Fixed | 7.1.0.10-r0 | ALPINE-CVE-2021-39212 |
| Alpine Linux 3.21 | imagemagick | Fixed | 7.1.0.10-r0 | ALPINE-CVE-2021-39212 |
| Alpine Linux 3.20 | imagemagick | Fixed | 7.1.0.10-r0 | ALPINE-CVE-2021-39212 |
| Alpine Linux 3.19 | imagemagick | Fixed | 7.1.0.10-r0 | ALPINE-CVE-2021-39212 |
| Alpine Linux 3.18 | imagemagick | Fixed | 7.1.0.10-r0 | ALPINE-CVE-2021-39212 |
| Alpine Linux 3.17 | imagemagick | Fixed | 7.1.0.10-r0 | ALPINE-CVE-2021-39212 |
| Alpine Linux 3.16 | imagemagick | Fixed | 7.1.0.10-r0 | ALPINE-CVE-2021-39212 |
| Alpine Linux 3.16 | imagemagick6 | Fixed | 6.9.12.31-r0 | ALPINE-CVE-2021-39212 |
| Alpine Linux 3.15 | imagemagick | Fixed | 7.1.0.10-r0 | ALPINE-CVE-2021-39212 |
| Alpine Linux 3.15 | imagemagick6 | Fixed | 6.9.12.31-r0 | ALPINE-CVE-2021-39212 |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- ImageMagick: affected: >= 7.0.0, < 7.1.0-7, < 6.9.12-22
References
- https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-qvhr-jj4p-j2qr
- https://github.com/ImageMagick/ImageMagick/commit/01faddbe2711a4156180c4a92837e2f23683cc68
- https://github.com/ImageMagick/ImageMagick/commit/35893e7cad78ce461fcaffa56076c11700ba5e4e
- https://lists.debian.org/debian-lts-announce/2023/05/msg00020.html
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.