CVE-2026-25965: ImageMagick's policy bypass through path traversal allows reading restricted content despite secured policy
ImageMagick is free and open-source software used for editing and manipulating digital images. Prior to versions 7.1.2-15 and 6.9.13-40, ImageMagick’s path security policy is enforced on the raw filename string before the filesystem resolves it. As a result, a policy rule such as /etc/ can be bypassed by a path traversal. The OS resolves the traversal and opens the sensitive file, but the policy matcher only sees the unnormalized path and therefore allows the read. This enables local file disclosure (LFI) even when policy-secure.xml is applied. Actions to prevent reading from files have been taken in versions .7.1.2-15 and 6.9.13-40 But it make sure writing is also not possible the following should be added to one's policy. This will also be included in ImageMagick's more secure policies by default.
Other sources
ImageMagick’s path security policy is enforced on the raw filename string before the filesystem resolves it. As a result, a policy rule such as /etc/ can be bypassed by a path traversal. The OS resolves the traversal and opens the sensitive file, but the policy matcher only sees the unnormalized path and therefore allows the read. This enables local file disclosure (LFI) even when policy-secure.xml is applied.
Actions to prevent reading from files have been taken. But it make sure writing is also not possible the following should be added to your policy:
<policy domain="path" rights="none" pattern="../"/>
And this will also be included in the project's more secure policies by default.
— GitHub
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
nuget/Magick.NET-Q8-x86to a version that resolves this vulnerability.Fixed in 14.10.3 - Upgrade
Upgrade
nuget/Magick.NET-Q8-x64to a version that resolves this vulnerability.Fixed in 14.10.3 - Upgrade
Upgrade
nuget/Magick.NET-Q8-arm64to a version that resolves this vulnerability.Fixed in 14.10.3 - Upgrade
Upgrade
nuget/Magick.NET-Q8-OpenMP-x64to a version that resolves this vulnerability.Fixed in 14.10.3 - Upgrade
Upgrade
nuget/Magick.NET-Q8-OpenMP-arm64to a version that resolves this vulnerability.Fixed in 14.10.3 - Upgrade
Upgrade
nuget/Magick.NET-Q8-AnyCPUto a version that resolves this vulnerability.Fixed in 14.10.3 - Upgrade
Upgrade
nuget/Magick.NET-Q16-x86to a version that resolves this vulnerability.Fixed in 14.10.3 - Upgrade
Upgrade
nuget/Magick.NET-Q16-x64to a version that resolves this vulnerability.Fixed in 14.10.3 - Upgrade
Upgrade
nuget/Magick.NET-Q16-arm64to a version that resolves this vulnerability.Fixed in 14.10.3 - Upgrade
Upgrade
nuget/Magick.NET-Q16-OpenMP-x86to a version that resolves this vulnerability.Fixed in 14.10.3 - Upgrade
Upgrade
nuget/Magick.NET-Q16-OpenMP-x64to a version that resolves this vulnerability.Fixed in 14.10.3 - Upgrade
Upgrade
nuget/Magick.NET-Q16-OpenMP-arm64to a version that resolves this vulnerability.Fixed in 14.10.3 - Upgrade
Upgrade
nuget/Magick.NET-Q16-HDRI-x86to a version that resolves this vulnerability.Fixed in 14.10.3 - Upgrade
Upgrade
nuget/Magick.NET-Q16-HDRI-x64to a version that resolves this vulnerability.Fixed in 14.10.3 - Upgrade
Upgrade
nuget/Magick.NET-Q16-HDRI-arm64to a version that resolves this vulnerability.Fixed in 14.10.3 - Upgrade
Upgrade
nuget/Magick.NET-Q16-HDRI-OpenMP-x64to a version that resolves this vulnerability.Fixed in 14.10.3 - Upgrade
Upgrade
nuget/Magick.NET-Q16-HDRI-OpenMP-arm64to a version that resolves this vulnerability.Fixed in 14.10.3 - Upgrade
Upgrade
nuget/Magick.NET-Q16-HDRI-AnyCPUto a version that resolves this vulnerability.Fixed in 14.10.3 - Upgrade
Upgrade
nuget/Magick.NET-Q16-AnyCPUto a version that resolves this vulnerability.Fixed in 14.10.3 - Upgrade
Upgrade
debian/imagemagickto a version that resolves this vulnerability.Fixed in 8:6.9.11.60+dfsg-1.3+deb11u12Fixed in 8:6.9.11.60+dfsg-1.6+deb12u9Fixed in 8:7.1.1.43+dfsg1-1+deb13u8Fixed in 8:7.1.2.18+dfsg1-1Fixed in 8:7.1.2.21+dfsg1-1 - Configuration
Update ImageMagick's policy (e.g., policy.xml / policy-secure.xml-based rules) to include protections that prevent both reading and writing through path traversal, explicitly ensuring /etc/* (and similar restricted paths) cannot be bypassed.
ImageMagick policy policy rule to prevent both reading and writing via path traversal = Add/ensure a rule that blocks reading and writing (not just reading) for sensitive paths such as /etc/*; writing must also be disallowed so traversal cannot bypass the rule
Event History
Frequently Asked Questions
What is the severity of CVE-2026-25965?
CVE-2026-25965 has a high severity rating due to its potential to allow unauthorized access to sensitive files.
How do I fix CVE-2026-25965?
To fix CVE-2026-25965, update ImageMagick to versions 7.1.2-15 or 6.9.13-40 or later.
What type of vulnerability is CVE-2026-25965?
CVE-2026-25965 is a path traversal vulnerability that allows the reading of restricted content.
What software is affected by CVE-2026-25965?
CVE-2026-25965 affects versions of ImageMagick prior to 7.1.2-15 and 6.9.13-40.
Is there a workaround for CVE-2026-25965?
There is no known workaround for CVE-2026-25965; upgrading to a fixed version is recommended.