# Photo Gallery, Sliders, Proofing and Themes – NextGEN Gallery <= 4.5.2 - Authenticated (Contributor+) Local File Inclusion via Shortcode Attributes

- **ID:** WPSEC-2026-1127
- **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 8.8 (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H)
- **Weakness:** CWE-98
- **Usage among sites WPSec scans:** plugin Medium, affected versions Medium (as of 2026-10-16)
- **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-1127/

## Description

The NextGEN Gallery plugin for WordPress is vulnerable to Local File Inclusion via gallery shortcode attributes in all versions up to, and including, 4.5.2. Shortcode attributes are passed into the template variable set, which is extract()ed with overwriting enabled immediately before the template include, so an attribute named like the internal template path variable replaces the validated path. This makes it possible for authenticated attackers, with contributor-level access and above, to include and execute arbitrary PHP files on the server, which can be used to bypass access controls, obtain sensitive data, or achieve code execution where files of an executable type can be uploaded or already exist on the server.

## References

- https://wpsec.com/vuln/WPSEC-2026-1127/
- 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-1127/

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.
