Feb 24, 2026·6 min read·56 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')
CVE-2026-45018 is a critical command injection vulnerability in Chainlit's Model Context Protocol (MCP) stdio transport backend. By submitting a crafted JSON payload containing dangerous argument options to an unauthenticated HTTP endpoint, a remote attacker can bypass executable validation rules and run arbitrary shell commands with the privileges of the active Python process.
An unauthenticated server-side request forgery (SSRF) vulnerability exists in Chainlit versions >= 2.4.0rc0 and < 2.12.0 when the Model Context Protocol (MCP) features are enabled. This vulnerability allows remote, unauthenticated attackers to force the backend application server to initiate arbitrary HTTP/HTTPS connections to internal subnets, localhost endpoints, or cloud metadata infrastructure.
An algorithmic complexity denial of service vulnerability exists in the Python icalendar library's component equality evaluation. Due to recursive nested comparisons inside list membership operations, parsing and validating calendar components with deep nesting triggers exponential execution time, blocking application threads and consuming 100% of the available CPU core.
JupyterHub is vulnerable to an unauthenticated Denial of Service (DoS) vulnerability. Prior to version 5.5.0, form-based authenticators failed to restrict the size of the username input field on failed logins, allowing remote attackers to exhaust host storage and memory resources.
The self-hosted HTTP transport mode of @arikusi/deepseek-mcp-server (an MCP server for DeepSeek V4) exposes its JSON-RPC endpoint (POST /mcp) without authentication in versions 1.4.2 through 1.7.0. Unauthenticated clients can establish Model Context Protocol sessions and invoke tools, consuming the host's configured DeepSeek API key.
A Server-Side Template Injection (SSTI) leading to Remote Code Execution (RCE) was discovered in the mcp-contextforge-gateway package before version 1.0.0. The vulnerability stems from an unsandboxed Jinja2 template rendering environment combined with an unsafe fallback mechanism using Python's native str.format() function. Attackers with template modification access could bypass static regex filters to execute arbitrary commands on the hosting platform.