Feb 24, 2026·6 min read·44 visits
ImageMagick contains an infinite loop vulnerability in `coders/meta.c`. A malicious image with invalid IPTC data can cause the parser to get stuck reading the same byte forever, resulting in a Denial of Service. Patch immediately to 7.1.2-15 or 6.9.13-40.
A logic error in ImageMagick's IPTC metadata parser allows for a trivial Denial of Service (DoS) attack. By supplying a crafted image file, an attacker can trap the processing thread in an infinite loop, causing 100% CPU utilization and potentially taking down image processing pipelines.
If you've ever uploaded a profile picture, generated a thumbnail, or converted a format on the web, you have almost certainly used ImageMagick. It is the silent workhorse of the internet, a library so ubiquitous that it exists in the dependency tree of nearly every major web framework. But heavy lies the crown, and when you are parsing untrusted binary data from anonymous users on the internet, you are playing Russian Roulette with a fully loaded glock.
CVE-2026-26066 isn't a flashy RCE (Remote Code Execution). It won't give me a reverse shell on your server (directly). But in the world of availability, it is a silent killer. It's a logic flaw in how the library handles IPTC (International Press Telecommunications Council) metadata—the stuff that tells news agencies who took the photo.
The vulnerability is a classic "Hamster Wheel" scenario. By feeding ImageMagick a specifically malformed image, we can trick the code into entering a state where it thinks it's making progress, but it's actually just staring at the same byte of memory, forever, screaming internally at 100% CPU usage. For a cloud environment running autoscaling groups, this is the kind of bug that turns a $50 monthly bill into a $5,000 monthly bill overnight.
To understand this bug, you have to think like a parser. The vulnerability lives in coders/meta.c, specifically in a function called formatIPTC. Its job is to iterate through binary data, looking for specific marker bytes (specifically 0x1c) that denote the start of an IPTC tag.
A robust parser follows a simple rule: Always Advance. No matter what garbage you find in the stream, you must move the read pointer forward. If you don't, you risk processing the same garbage again.
The developer implemented a while loop that checks if the current byte (c) is EOF (End of File). Inside that loop, if they found the magic byte 0x1c, they processed the tag. But what if they found something else? They wrote an else block to handle invalid data. Theoretically, this block should skip the garbage and move on.
In practice, they made a fatal error. Instead of reading the next byte from the file stream to continue the search, they manually set the variable c to 0 and hit continue. This sends the execution flow back to the top of the while loop. Since 0 is not EOF, the loop runs again. But because they didn't call ReadBlobByte, the file pointer hasn't moved. The variable c is processed, the else block triggers again, sets c to 0, and we spin. Forever.
Let's look at the diff. It's almost painful in its simplicity. This is the kind of bug that survives code review because it looks like error handling, but it's actually an infinite loop trap.
Here is the vulnerable logic in coders/meta.c:
// Vulnerable Code
c = ReadBlobByte(ifile);
while (c != EOF)
{
if (c == 0x1c)
{
// ... complex parsing logic for valid tags ...
}
else
{
// THE BUG IS HERE
c = 0; // Reset c to a non-EOF value
continue; // Restart loop WITHOUT reading a new byte
}
}When continue is hit, the code jumps back to while (c != EOF). Since c was forced to 0, the check passes. The if (c == 0x1c) check fails (because 0 is not 0x1c). The else block runs again. c is set to 0. Ad infinitum.
Here is the fix provided in commit 880057ce34f6da9dff2fe3b290bbbc45b743e613:
break;
}
else
{
- c=0;
+ c=ReadBlobByte(ifile);
continue;
}By replacing the assignment c=0 with c=ReadBlobByte(ifile), the developer ensures that even when garbage data is encountered, the file stream advances to the next byte. Eventually, ReadBlobByte will return EOF, and the loop will terminate naturally.
Exploiting this does not require a complex heap groom or ROP chain. It requires a hex editor. The attack vector is strictly Local (AV:L), meaning you need to get the file onto the system, but in the context of a web application processing user uploads, "Local" just means "I uploaded a file."
The Recipe:
0x1c marker, place a 0x00 (or literally anything other than 0x1c or EOF).When the backend worker (Sidekiq, Celery, or a direct PHP script) picks up this file to resize it or strip metadata, it invokes coders/meta.c. The process will immediately pin a CPU core to 100%.
Now, imagine an attacker automates this. They upload 50 of these images. If your server has 48 cores, you are now completely dead in the water. Legitimate requests time out. If you are on AWS Lambda or similar serverless architecture, the function will run until it hits its maximum execution time limit, racking up costs for compute time that resulted in absolutely nothing.
The remediation is straightforward: you must update the library. Because ImageMagick is often installed as a system dependency or a background shared library, simply updating your application code might not be enough—you need to update the OS packages.
For System Administrators:
Update to ImageMagick 7.1.2-15 or 6.9.13-40. If you are using a package manager (apt, yum, apk), ensure you pull the latest security patches.
For Developers:
If you are using wrappers like Magick.NET, you are also vulnerable because the native logic is wrapped. Update Magick.NET to version 14.10.3 or newer.
Defense in Depth: Beyond patching, this vulnerability highlights the need for Resource Limits.
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
ImageMagick v7 ImageMagick | >= 7.0.0-0, < 7.1.2-15 | 7.1.2-15 |
ImageMagick v6 ImageMagick | < 6.9.13-40 | 6.9.13-40 |
Magick.NET dlemstra | < 14.10.3 | 14.10.3 |
| Attribute | Detail |
|---|---|
| CWE | CWE-835 (Infinite Loop) |
| CVSS v3.1 | 6.2 (Medium) |
| Attack Vector | Local (User Supplied File) |
| Availability Impact | High (DoS) |
| Exploit Status | Trivial / No Public PoC yet |
| EPSS Score | 0.00013 (Low probability) |
Loop with Unreachable Exit Condition ('Infinite Loop')
Code16 Sharp versions from 9.0.0 up to (but not including) 9.22.3 are vulnerable to a missing authorization flaw in the Quick Creation Command feature. The ApiEntityListQuickCreationCommandController fails to validate entity-level 'create' policies before returning administrative form designs or processing database modifications. Authenticated users with restricted access can bypass policy boundaries to access creation configurations and insert records.
CVE-2026-49471 is a high-severity security vulnerability in Serena, an AI-assisted coding Model Context Protocol (MCP) toolkit. In versions prior to v1.5.2, Serena's built-in web dashboard exposes an unauthenticated Flask API on a predictable port. Lacking host validation and CSRF protections, this endpoint is vulnerable to DNS Rebinding. An attacker can lure a user to a malicious webpage, bypass the Same-Origin Policy (SOP), rewrite the AI agent's persistent memory, and execute arbitrary commands on the host operating system via the autonomous agent's shell execution engine.
The trapster honeypot package is vulnerable to a remote denial of service (DoS) vulnerability due to uncontrolled recursion during the parsing of malformed DNS compression pointers in the decode_labels function.
A critical Use-After-Free (UAF) memory corruption vulnerability exists in the oneringbuf Rust crate prior to version 0.8.0. The vulnerability allows safe Rust code to instantiate and clone reference wrappers that point to heap-allocated ring buffers. Dropping one wrapper prematurely reclaims the backing memory, leading to dangling pointer references and subsequent Use-After-Free or Double Free states.
Januscape (CVE-2026-53359) is a critical Use-After-Free vulnerability in the x86 Shadow MMU component of the Linux Kernel's KVM subsystem. A logic error in shadow page tracking permits unauthorized page reuse without validating architectural execution roles, leading to dangling pointers in reverse mapping (rmap) tracking entries during guest memory teardown.
CVE-2026-48282 is a critical unauthenticated path traversal and arbitrary file write vulnerability in the Remote Development Services (RDS) component of Adobe ColdFusion. The vulnerability allows a remote, unauthenticated attacker to bypass directory boundaries and write arbitrary files, including CFML-based web shells, onto the host server. This flaw is actively exploited in the wild and enables full unauthenticated remote code execution under the privileges of the ColdFusion service account.