From ac19523b5ba2a8617f306ba8152e9de33a196bb1 Mon Sep 17 00:00:00 2001 From: Plamen Georgiev Date: Wed, 20 May 2026 17:30:09 +0300 Subject: [PATCH 1/4] Fixed XSS vulnerability report via Gallery shortcode --- easy-image-gallery.php | 2 +- includes/metabox.php | 18 ++++++-- includes/template-functions.php | 80 +++++++++++++++++++++++---------- readme.txt | 6 ++- 4 files changed, 78 insertions(+), 28 deletions(-) diff --git a/easy-image-gallery.php b/easy-image-gallery.php index a03e4f8..b4f9522 100644 --- a/easy-image-gallery.php +++ b/easy-image-gallery.php @@ -3,7 +3,7 @@ Plugin Name: Easy Image Gallery Plugin URI: https://devrix.com/ Description: An easy to use image gallery with drag & drop re-ordering -Version: 1.5.4 +Version: 1.5.5 Author: DevriX Author URI: https://devrix.com/ Text Domain: easy-image-gallery diff --git a/includes/metabox.php b/includes/metabox.php index bdf9df4..5a8cf5c 100644 --- a/includes/metabox.php +++ b/includes/metabox.php @@ -112,6 +112,10 @@ function easy_image_gallery_metabox() { if ( isset( $get_galleries ) && ! empty( $get_galleries ) ) { foreach ( $get_galleries[0] as $gallery ) { $gallery_count = $gallery_count + 1; + $gallery_shortcode = easy_image_gallery_sanitize_gallery_id( $gallery['SHORTCODE'] ); + if ( '' === $gallery_shortcode ) { + $gallery_shortcode = (string) wp_rand( 100, 999 ); + } $get_attachments = $gallery['DATA']; // Convert attachements to string @@ -139,8 +143,8 @@ function easy_image_gallery_metabox() { Insert this shortcode in the content - - "> + + ">