
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-23876 is a heap buffer overflow vulnerability in ImageMagick's XBM image decoder (ReadXBMImage) that allows an attacker to write controlled data past the allocated heap buffer by processing a maliciously crafted XBM image file. It affects ImageMagick versions prior to 7.1.2-13 (7.x branch) and prior to 6.9.13-38 (6.x branch). The vulnerability was published on January 20, 2026, with patches released the same day. It carries a CVSS v3.1 base score of 9.8 (Critical) per NVD/Feedly aggregated data, though the GitHub Security Advisory scores it at 8.1 (High) with Attack Complexity: High (GitHub Advisory, Red Hat Bugzilla).
The root cause is an integer truncation (CWE-190) in coders/xbm.c at lines 349–350, where image->rows (a size_t) is cast to unsigned int when computing the allocation length, causing the buffer to be drastically undersized for large row values. The write loop at lines 369–377, however, iterates using the original non-truncated image->rows value, resulting in a heap-based buffer overflow (CWE-122) where attacker-controlled data is written far beyond the allocated region. For example, setting #define se_height 21474836481 (0x500000001) truncates the allocation to ~1 byte while the loop performs billions of write iterations. The fix (commit 2fae241) changes bytes_per_line and length to size_t types and introduces a HeapOverflowSanityCheckGetSize guard before allocation, with the loop bound changed to use the validated length variable (GitHub Advisory, GitHub Commit).
Successful exploitation can result in remote code execution, complete system compromise, and full loss of confidentiality, integrity, and availability on the affected host. Because any image read or identify operation can trigger the overflow — including thumbnail generation, format conversion, and metadata extraction — the attack surface is broad, encompassing web applications with image upload functionality, content management systems (e.g., WordPress, Drupal with ImageMagick backends), and CI/CD pipelines processing user-submitted images. No user interaction is required beyond submitting a crafted image, and the attacker controls both the overflow size and the data written, enabling reliable memory corruption (GitHub Advisory).
A proof-of-concept exploit is publicly referenced via the GitHub Security Advisory, though no evidence of active in-the-wild exploitation has been observed as of the time of reporting (GitHub Advisory). The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. The EPSS score is approximately 0.043% (0.000430), indicating a currently low probability of exploitation in the near term. No specific threat actor attribution has been reported. The vulnerability is detectable by multiple commercial scanners including Nessus and Qualys (Feedly).
#define height value (e.g., #define se_height 21474836481) that, when truncated to unsigned int, results in a near-zero allocation size while the actual row count remains enormous.magick identify, magick convert, thumbnail generation) will invoke ReadXBMImage and trigger the heap buffer overflow.#define width/height values (e.g., values exceeding 2^32) in upload directories or temporary processing folders; unexpected web shells or scripts in the ImageMagick working directory..xbm files or BMP files containing embedded XBM data from untrusted sources; ImageMagick crash logs or core dumps referencing ReadXBMImage in coders/xbm.c; AddressSanitizer output mentioning heap-buffer-overflow at xbm.c:377./bin/bash, curl, wget, python) following image processing operations; abnormal memory usage or crashes in magick or convert processes.Upgrade ImageMagick to version 7.1.2-13 or later (7.x branch) or 6.9.13-38 or later (6.x branch), which add overflow checks via HeapOverflowSanityCheckGetSize and correct the integer truncation in coders/xbm.c (GitHub Commit). Red Hat has addressed this in RHSA-2026:3058 for Red Hat Enterprise Linux 7 Extended Lifecycle Support (Red Hat Bugzilla). Debian, Ubuntu, SUSE, and Amazon Linux 2 have also issued advisories and updated packages. If immediate patching is not possible, implement strict file type validation and size limits on image uploads, restrict ImageMagick's XBM codec via a policy file (/etc/ImageMagick-*/policy.xml with <policy domain="coder" rights="none" pattern="XBM" />), and sandbox image processing workloads to limit blast radius.
The vulnerability received coverage from security news outlets including Security Online and The Hacker Wire shortly after disclosure (Security Online). The Belgium Centre for Cybersecurity (CCB) issued a warning about the heap buffer overflow risk (CCB Advisory). CISA included it in its weekly vulnerability bulletin (SB26-026). Social media discussion on Bluesky and Mastodon noted the severity of the issue given ImageMagick's widespread use in web application stacks. A technical write-up was published by Infinit Security detailing the XBM parser flaw (Infinit Security).
Fix availability across major Linux distributions and their releases.
bookworm
imagemagick: 8:6.9.11.60+dfsg-1.6+deb12u6
sid
imagemagick: 8:7.1.2.13+dfsg1-1
trixie
imagemagick: 8:7.1.1.43+dfsg1-1+deb13u5
bionic (esm-infra)
imagemagick: 8:6.9.7.4+dfsg-16ubuntu6.15+esm9
devel
imagemagick
focal (esm-apps)
imagemagick: 8:6.9.10.23+dfsg-2.1ubuntu11.11+esm7
jammy
imagemagick
jammy (esm-apps)
imagemagick: 8:6.9.11.60+dfsg-1.3ubuntu0.22.04.5+esm7
noble
imagemagick
noble (esm-apps)
imagemagick: 8:6.9.12.98+dfsg1-5.2ubuntu0.1~esm6
resolute
imagemagick
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."