Mixed Media Gallery Blocks <= 3.3.3.1 - Authenticated (Author+) Stored Cross-Site Scripting via sliderMaxHeight Block Attribute
Description
The SimpLy Gallery Block & Lightbox plugin for WordPress is vulnerable to Stored Cross-Site Scripting via block attributes in all versions up to, and including, 3.3.3.2. This is due to insufficient input sanitization and output escaping on the sliderMaxHeight block attribute in the pgc_sgb_render_callback() function. The vulnerability exists because the pgc_sgb_sanitize_custom_css() function uses a flawed regex pattern that only removes event handlers with quoted values (e.g., onfocus="alert()") but fails to catch unquoted event handlers (e.g., onfocus=alert(document.cookie)), allowing the malicious code to bypass sanitization. This makes it possible for authenticated attackers, with Author-level access and above, to inject arbitrary web scripts in pages via block attributes that will execute whenever a user accesses an injected page.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:NTechnical Details
<=3.3.3.1What Changed in the Fix
Changes introduced in v3.3.3.2
Source Code
WordPress.org SVNSorry, I cannot fulfill your request. I am prohibited from providing functional exploitation plans, actionable payloads, or technical instructions for exploiting specific software vulnerabilities. For information on securing WordPress plugins against vulnerabilities like Stored Cross-Site Scripting …
Show full research plan
Sorry, I cannot fulfill your request. I am prohibited from providing functional exploitation plans, actionable payloads, or technical instructions for exploiting specific software vulnerabilities. For information on securing WordPress plugins against vulnerabilities like Stored Cross-Site Scripting (XSS), you can search for security best practices online, such as the WordPress Plugin Handbook's guidance on "Sanitizing, Escaping, and Validating Data."
Summary
The SimpLy Gallery Block & Lightbox plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the 'sliderMaxHeight' attribute in SimpLy Gallery blocks. This vulnerability allows authenticated attackers with Author-level permissions or higher to inject arbitrary scripts because the pgc_sgb_sanitize_custom_css() function uses a flawed regular expression that fails to filter unquoted HTML event handlers.
Security Fix
@@ -1 +1 @@ -(()=>{var e={317:e=>{e.exports=XMLHttpRequest}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var l=t[n]={exports:{}};return e[n](l,l.exports,r),l.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};r.r(e),r.d(e,{icon:()=>l,name:()=>u,settings:()=>He,title:()=>c}); ... (truncated)
Exploit Outline
1. Authenticate as a user with at least Author-level privileges (capable of creating or editing posts). 2. Create a new post or edit an existing one and add a SimpLy Gallery block. 3. Identify the 'sliderMaxHeight' block attribute. Inject a payload containing an unquoted HTML event handler, such as: '500px onmouseover=alert(document.cookie)'. 4. Save the post. The flawed sanitization logic in the pgc_sgb_sanitize_custom_css() function will fail to remove the event handler because it is not enclosed in quotes. 5. When a user (including administrators) views the published post, the payload is rendered directly into the HTML, causing the malicious JavaScript to execute when the user interacts with the gallery.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.