CVE-2026-53653: Grav: Unauthenticated denial of service via unbounded image derivative dimensions

Published Jul 10, 2026
·
Updated

Summary An unauthenticated visitor exhausts server memory and CPU by requesting an image with oversized resize dimensions. One request drives a worker to several gigabytes of RAM and tens of seconds of CPU. A few concurrent requests take the host down.

Details Grav::fallbackUrl() (system/src/Grav/Common/Grav.php:800-804) loops over every query parameter and, when the name matches ImageMedium::$magicactions, calls that method on the medium with the comma-split value as arguments:

php foreach ($uri->query(null, true) as $action => $params) { if (inarray($action, ImageMedium::$magicactions, true)) { calluserfuncarray([&$medium, $action], explode(',', $params)); } }

forceResize runs with force=true, so it sets the output size to the attacker's values with no clamp against the source or any ceiling. The getgrav/image GD adapter then calls imagecreatetruecolor($w, $h). libgd allocates that buffer outside PHP's emalloc, so memorylimit does not cap it. Grav exposes no system.images.maxwidth/maxheight setting.

PoC Any page that serves an image works. With a 200x150 source image:

GET /home/test.png?forceResize=20000,20000

Measured on PHP 8.4.21 with memorylimit=128M:

- peak worker RSS 3,109 MB - 21.9 s CPU - HTTP 200, 1.6 MB response

8000x8000 already needs ~244 MB. The cache key includes the dimensions, so varying them forces fresh work on every request.

Impact Unauthenticated denial of service against any Grav site that serves images. No account, plugin, or non-default config required.

Fix Clamp the request-derived dimensions before dispatch, behind a configurable cap. The image library is the wrong layer; bound the arguments at the request boundary.

diff --- a/system/src/Grav/Common/Grav.php +++ b/system/src/Grav/Common/Grav.php @@ public function fallbackUrl($path) foreach ($uri->query(null, true) as $action => $params) { if (inarray($action, ImageMedium::$magicactions, true)) { - calluserfuncarray([&$medium, $action], explode(',', $params)); + $args = explode(',', $params); + $max = (int) $config->get('system.images.maxdimension', 8000); + if ($max > 0 + && inarray($action, ['resize', 'forceResize', 'cropResize', 'cropZoom', 'zoomCrop', 'crop'], true)) { + foreach ($args as $a) { + if (isnumeric($a) && (int) $a > $max) { + return false; // reject oversized derivative request + } + } + } + calluserfuncarray([&$medium, $action], $args); } }

Document system.images.maxdimension (default 8000) so operators can tune it. A total-pixel ceiling (width height) is a stricter alternative.

Other sources

Grav is a file-based Web platform. Prior to 1.7.53 and 2.0.0-rc.8, Grav allows an unauthenticated visitor to exhaust server memory and CPU by requesting image derivatives with oversized dimensions through URL query image actions such as forceResize in Grav::fallbackUrl, which passes request parameters to ImageMedium magic actions without a dimension or pixel ceiling. This issue is fixed in versions 1.7.53 and 2.0.0-rc.8.

NVD

Affected Software

3 affected componentsFixes available
Grav Grav>1.7.0<=1.7.53, >2.0.0-rc.7<2.0.0-rc.8
composer/getgrav/grav<1.7.53
1.7.53
composer/getgrav/grav>=2.0.0-beta.1<2.0.0-rc.8
2.0.0-rc.8

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade composer/getgrav/grav to a version that resolves this vulnerability.

    Fixed in 1.7.53
  2. Upgrade

    Upgrade composer/getgrav/grav to a version that resolves this vulnerability.

    Fixed in 2.0.0-rc.8
  3. Upgrade

    Upgrade grav to a version that resolves this vulnerability.

    Fixed in 1.7.53
  4. Upgrade

    Upgrade grav to a version that resolves this vulnerability.

    Fixed in 2.0.0-rc.8
  5. Configuration

    Set (or leave) system.images.max_dimension, which caps request-derived image derivative dimensions. In Grav::fallbackUrl (system/src/Grav/Common/Grav.php), clamp the parsed query-dimension arguments for image actions (e.g., forceResize/resize/crop/cropZoom/zoomCrop) so that any numeric dimension (int) greater than the configured cap is rejected (return false).

    Grav system.images.max_dimension = 8000

Event History

Jul 10, 2026
CVE Published
via MITRE·04:12 PM
Data Sourced
via MITRE·04:12 PM
DescriptionWeakness
Data Sourced
via NVD·05:16 PM
DescriptionSeverityWeakness
Aug 14, 2026
Advisory Published
via GitHub·07:23 PM
Data Sourced
via GitHub·07:23 PM
DescriptionWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-53653?

CVE-2026-53653 has a risk score of 52, indicating a moderate level of severity.

2

How do I fix CVE-2026-53653?

To fix CVE-2026-53653, upgrade Grav to version 1.7.53 or 2.0.0-rc.8 or later.

3

What type of vulnerability is CVE-2026-53653?

CVE-2026-53653 is an unauthenticated denial of service vulnerability.

4

What can an attacker do with CVE-2026-53653?

An attacker can exhaust server memory and CPU resources by requesting oversized image derivatives.

5

Which versions of Grav are affected by CVE-2026-53653?

Grav versions prior to 1.7.53 and 2.0.0-rc.8 are affected by CVE-2026-53653.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203