# Mixed Media Gallery Blocks <= 3.5.0 - Authenticated (Contributor+) Stored Cross-Site Scripting via Gallery Item Link URL

- **ID:** WPSEC-2026-3940
- **Plugin:** SimpLy Gallery (`simply-gallery-block`), https://wordpress.org/plugins/simply-gallery-block/
- **Affected versions:** from 1.5.1 before 3.5.1
- **Fixed in:** 3.5.1 (Update to 3.5.1 or later.)
- **Severity:** Medium 5.4 (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N)
- **Weakness:** CWE-79
- **Usage among sites WPSec scans:** plugin Medium, affected versions Medium (as of 2026-11-25)
- **Attack surface analysis:** https://attacksurface.wpsec.com/plugin/simply-gallery-block
- **Fix released:** 2026-11-24
- **Published:** 2026-11-26
- **URL:** https://wpsec.com/vuln/WPSEC-2026-3940/

## Description

The SimpLy Gallery plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the gallery item link URL (the 'pgc_sgb_link' attachment meta and the gallery block's 'itemsMetaDataCollection' attribute) in all versions up to, and including, 3.5.0, due to insufficient validation of the link URL scheme. The link is stored after only sanitize_text_field() or kses filtering, neither of which removes a javascript: URL, and the gallery front-end scripts assign it to the item's link button href without checking it. This makes it possible for authenticated attackers, with contributor-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user clicks the injected gallery link button.

## References

- https://wpsec.com/vuln/WPSEC-2026-3940/
- https://plugins.svn.wordpress.org/simply-gallery-block/tags/3.5.1/
- https://wordpress.org/plugins/simply-gallery-block/

Source: WPSec, https://wpsec.com/vuln/WPSEC-2026-3940/

License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Free to use, share and adapt, also commercially, if you credit WPSec and link to this advisory.
