cve.bz

CVE-2021-39212 imagemagick imagemagick: Race Condition

3.6 lowEPSS 0.4%Fix available

Low (3.6) in imagemagick imagemagick. EPSS 0.4% estimated probability of exploitation activity in the next 30 days.

On this page
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}" />.

Severity

CVSS 3.1

3.6 low
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N
EPSS
0.4% (unchanged from 0.4% a week ago; 0.4% 30 days ago) estimated probability of exploitation activity in the next 30 days; 30th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWEs
CWE-362 Concurrent Execution using Shared Resource with Improper Synchronization (Race Condition)
CWE-668 Exposure of Resource to Wrong Sphere
OWASP Top 10
A01:2025 Broken Access Control, A06:2025 Insecure Design
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2021-39212 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-39212?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-39212?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2021-39212 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
imagemagick:imagemagickfrom 6.9.12-0 before 6.9.12-22
imagemagick:imagemagickfrom 7.1.0-0 before 7.1.0-7

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian10imagemagick8:6.9.10.23+dfsg-2.1+deb10u5DLA-3429-1
Debian12, 13, 14imagemagick8:6.9.11.60+dfsg-1.5DEBIAN-CVE-2021-39212
Ubuntu18.04:LTSimagemagick8:6.9.7.4+dfsg-16ubuntu6.14USN-5736-1
Ubuntu20.04:LTSimagemagick8:6.9.10.23+dfsg-2.1ubuntu11.9UBUNTU-CVE-2021-39212 USN-6200-1
UbuntuPro:14.04:LTSimagemagick8:6.7.7.10-6ubuntu3.13+esm3USN-5736-1
UbuntuPro:16.04:LTSimagemagick8:6.8.9.9-7ubuntu5.16+esm5USN-5736-1
UbuntuPro:16.04:LTSimagemagick8:6.8.9.9-7ubuntu5.16+esm8USN-6200-1
UbuntuPro:18.04:LTSimagemagick8:6.9.7.4+dfsg-16ubuntu6.15+esm1USN-6200-1
UbuntuPro:20.04:LTSimagemagick8:6.9.10.23+dfsg-2.1ubuntu11.4+esm1USN-5736-2
UbuntuPro:22.04:LTSimagemagick8:6.9.11.60+dfsg-1.3ubuntu0.22.04.1+esm1UBUNTU-CVE-2021-39212 USN-5736-2 USN-6200-1
Alpinev3.15, v3.16imagemagick66.9.12.31-r0ALPINE-CVE-2021-39212
Alpinev3.15, v3.16, v3.17 and 7 moreimagemagick7.1.0.10-r0ALPINE-CVE-2021-39212

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; the Alpine secdb, CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Alpine.

Red Hat

Red Hat rates this Moderate.

Red Hat's mitigation

Users are advised to use the coder policy instead of the module policy as a workaround.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 6ImageMagickOut of support scope
Red Hat Enterprise Linux 7ImageMagickOut of support scope

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2021-39212.

Attack patterns (CAPEC)

  • CAPEC-26 Leveraging Race Conditions Likelihood: High · Severity: High
  • CAPEC-29 Leveraging Time-of-Check and Time-of-Use (TOCTOU) Race Conditions Likelihood: High · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON