# Gallery : FooGallery <= 3.3.37 - Authenticated (Contributor+) Stored Cross-Site Scripting via Block 'thumbnail_size' and 'thumbnail_dimensions' Attributes

- **ID:** WPSEC-2026-4634
- **Plugin:** FooGallery Photo Gallery : Image, Video & Masonry Galleries (`foogallery`), https://wordpress.org/plugins/foogallery/
- **Affected versions:** all versions before 3.3.48
- **Fixed in:** 3.3.48 (Update to 3.3.48 or later.)
- **Severity:** Medium 6.4 (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N)
- **Weakness:** CWE-79
- **Usage among sites WPSec scans:** plugin Medium, affected versions Medium (as of 2026-12-04)
- **Attack surface analysis:** https://attacksurface.wpsec.com/plugin/foogallery
- **Fix released:** 2026-12-03
- **Published:** 2026-12-04
- **URL:** https://wpsec.com/vuln/WPSEC-2026-4634/

## Description

The FooGallery Photo Gallery plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the 'thumbnail_size' and 'thumbnail_dimensions' attributes of the FooGallery block in all versions up to, and including, 3.3.37, due to insufficient input validation. The plugin accepts these attributes as arrays with any keys, and the gallery templates use the whole array as their rendering arguments. Extra keys such as 'link_attributes' and 'image_attributes' are then merged into the thumbnail link and image tags, so the link's href can be replaced with a javascript: URL. 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 accesses an injected page.

## References

- https://wpsec.com/vuln/WPSEC-2026-4634/
- https://plugins.svn.wordpress.org/foogallery/tags/3.3.48/
- https://wordpress.org/plugins/foogallery/

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

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.
