# Photo Gallery, Sliders, Proofing and Themes – NextGEN Gallery <= 4.5.2 - Authenticated (Contributor+) PHP Object Injection via Shortcode Template Attribute

- **ID:** WPSEC-2026-1125
- **Plugin:** Photo Gallery, Sliders, Proofing and Themes – NextGEN Gallery (`nextgen-gallery`), https://wordpress.org/plugins/nextgen-gallery/
- **Affected versions:** all versions before 4.5.3
- **Fixed in:** 4.5.3 (Update to 4.5.3 or later.)
- **Severity:** High 7.5 (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H)
- **Weakness:** CWE-502
- **Usage among sites WPSec scans:** plugin Medium, affected versions Medium (as of 2026-10-17)
- **Attack surface analysis:** https://attacksurface.wpsec.com/plugin/nextgen-gallery
- **Fix released:** 2026-10-15
- **Published:** 2026-10-16
- **URL:** https://wpsec.com/vuln/WPSEC-2026-1125/

## Description

The NextGEN Gallery plugin for WordPress is vulnerable to PHP Object Injection via the template shortcode attribute and import folder paths in all versions up to, and including, 4.5.2 due to stream-wrapper paths such as phar:// not being rejected before they reach file_exists() when resolving relative template names. This makes it possible for authenticated attackers, with contributor-level access and above, to trigger deserialization of the metadata of an attacker-supplied Phar archive on sites running PHP 7.4 or earlier. No known POP chain is present in the plugin itself; if a POP chain is present via an additional plugin or theme, this could allow the attacker to delete arbitrary files, retrieve sensitive data, or execute code.

## References

- https://wpsec.com/vuln/WPSEC-2026-1125/
- https://plugins.svn.wordpress.org/nextgen-gallery/tags/4.5.3/
- https://wordpress.org/plugins/nextgen-gallery/

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

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.
