# Photo Gallery, Sliders, Proofing and Themes – NextGEN Gallery <= 4.5.5 - Authenticated (Contributor+) Stored Cross-Site Scripting via 'thumbnail_width' and 'thumbnail_height' Shortcode Attributes

- **ID:** WPSEC-2026-2829
- **Plugin:** Photo Gallery, Sliders, Proofing and Themes – NextGEN Gallery (`nextgen-gallery`), https://wordpress.org/plugins/nextgen-gallery/
- **Affected versions:** from 3.50 before 4.5.6
- **Fixed in:** 4.5.6 (Update to 4.5.6 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-11-10)
- **Attack surface analysis:** https://attacksurface.wpsec.com/plugin/nextgen-gallery
- **Fix released:** 2026-11-09
- **Published:** 2026-11-10
- **URL:** https://wpsec.com/vuln/WPSEC-2026-2829/

## Description

The NextGEN Gallery plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the 'thumbnail_width' and 'thumbnail_height' attributes of the [ngg] shortcode in all versions from 3.50 up to, and including, 4.5.5. Shortcode attributes are copied into the gallery's display settings without validation, and LegacyImage::__get('size') writes the values unescaped into the width and height attributes that the legacy gallery templates print. 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-2829/
- https://plugins.svn.wordpress.org/nextgen-gallery/tags/4.5.6/
- https://wordpress.org/plugins/nextgen-gallery/

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

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.
