Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-109398 Overview
CVE-2026-109398 is a denial of service vulnerability in Gumlet php-image-resize versions before 3.0.1. The ImageResize constructor in lib/ImageResize.php passes attacker-supplied images to PHP GD imagecreatefrom* functions without validating decoded pixel dimensions. Remote attackers can submit small, highly compressed images that decode into large bitmaps, exhausting PHP memory and terminating the worker process. The flaw is tracked under CWE-409 (Improper Handling of Highly Compressed Data).
Critical Impact
Unauthenticated remote attackers can crash PHP worker processes by uploading decompression bomb images, degrading or disabling image processing endpoints.
Affected Products
- Gumlet php-image-resize versions before 3.0.1
- PHP applications using the ImageResize constructor with untrusted image input
- Web services exposing image upload or resize endpoints backed by this library
Discovery Timeline
- 2026-10-12 - CVE-2026-109398 published to NVD
- 2026-10-16 - Last updated in NVD database
Technical Details for CVE-2026-109398
Vulnerability Analysis
The ImageResize constructor in lib/ImageResize.php accepts image input and immediately invokes PHP GD decoding functions such as imagecreatefrompng, imagecreatefromjpeg, and imagecreatefromgif. These functions allocate a raw pixel canvas sized to the image header dimensions, not the compressed file size. A 56 KB PNG declaring a 10000×10000 canvas forces GD to allocate hundreds of megabytes of memory. When the allocation exceeds memory_limit, PHP terminates the worker. Repeated requests from an attacker drain the pool of available workers and deny service to legitimate users.
Root Cause
The library did not enforce any upper bound on the product of width times height before passing data to GD. Image format headers can declare arbitrarily large dimensions in a few bytes, so compression ratios of 1000:1 or higher are trivial to craft. Without a pixel budget, the decoder trusts attacker-controlled metadata.
Attack Vector
An unauthenticated remote attacker uploads a crafted PNG, JPEG, or GIF to any endpoint that constructs an ImageResize object from the file. The decode operation exceeds memory_limit, PHP emits a fatal error, and the FPM or Apache worker exits. Sustained requests cause availability loss on the image processing service.
// Patched fix in lib/ImageResize.php
public int $interlace = 1;
/**
* Maximum number of source pixels (width × height) allowed when loading an image.
* Prevents image-bomb attacks where a small compressed file (e.g. a 56 KB PNG)
* decompresses into a canvas large enough to exhaust PHP memory.
*
* Default: 15,000,000 (~3873×3873 px). A 4000×4000 image requires ~61 MB of
* raw canvas memory, which exhausts a typical 128 M memory_limit.
* Set to 0 to disable the limit (only do this for fully trusted input).
*/
public int $max_source_pixels = 15_000_000;
public int $source_type;
protected $source_image;
// Source: https://github.com/gumlet/php-image-resize/commit/10c1f386e672536d82be0f39b236a80d87767a50
The patch introduces a configurable $max_source_pixels ceiling (default 15,000,000) that is checked before GD decoding, aborting the operation on oversized canvases.
Detection Methods for CVE-2026-109398
Indicators of Compromise
- PHP error logs containing Allowed memory size of N bytes exhausted originating from imagecreatefrom* calls in lib/ImageResize.php.
- FPM or Apache worker crashes correlated with image upload requests from a single source IP.
- Uploaded image files with unusually high dimension-to-size ratios (for example, multi-thousand pixel width with sub-100 KB payload).
Detection Strategies
- Inspect application logs for repeated fatal memory errors tied to the ImageResize class or GD decoders.
- Monitor upload endpoints for abnormal file dimension metadata using a WAF or edge inspection rule.
- Flag HTTP 500 or 502 bursts following POST requests to image handling routes.
Monitoring Recommendations
- Alert on PHP-FPM pool saturation and worker respawn rates above baseline.
- Track memory_limit exhaustion counts per endpoint over time.
- Correlate image upload volume with worker crash counts to identify abuse patterns.
How to Mitigate CVE-2026-109398
Immediate Actions Required
- Upgrade gumlet/php-image-resize to version 3.0.1 or later using Composer.
- Audit all code paths that instantiate ImageResize from user-supplied input.
- Reduce PHP memory_limit on image processing workers to contain blast radius if abuse occurs.
Patch Information
The fix is included in the GitHub Release Version 3.0.1 and corresponds to commits 10c1f38 and cd01c9e. Full technical context is published in the GitHub Security Advisory GHSA-3g9v-hjrx-mg5h and the VulnCheck Denial of Service Advisory.
Workarounds
- Validate uploaded image dimensions with getimagesize() before constructing ImageResize, rejecting any image whose width × height exceeds a safe pixel budget.
- Enforce strict request size limits and MIME type checks at the web server and WAF layers.
- Isolate image processing into a dedicated worker pool with a lower memory_limit to prevent impact on other application endpoints.
# Upgrade to the patched release via Composer
composer require gumlet/php-image-resize:^3.0.1
# Optional: tighten the pixel budget for untrusted input
# In application code:
# $resizer = new \Gumlet\ImageResize($path);
# $resizer->max_source_pixels = 4_000_000; // ~2000x2000
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

