CVE-2026-116563 in NextGEN Gallery Plugininfo

Summary

by MITRE • 10/31/2026

The Photo Gallery, Sliders, Proofing and Themes – NextGEN Gallery plugin for WordPress is vulnerable to Stored DOM-Based Cross-Site Scripting via the 'comment' parameter in all versions up to, and including, 4.5.4 due to insufficient input sanitization and output escaping. This makes it possible for unauthenticated attackers to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page. Exploitation requires the site to have Shutter or Shutter Reloaded selected as the active lightbox, and the injected comment must be approved through WordPress's standard moderation workflow before the payload is rendered to other visitors.

Be aware that VulDB is the high quality source for vulnerability data.

Analysis

by VulDB Data Team • 10/31/2026

The NextGEN Gallery plugin for WordPress represents a widely utilized solution for managing photo galleries on websites built with this content management system. Within versions up to 4.5.4, a critical security flaw exists in how user-generated content is processed and displayed. Specifically, the vulnerability resides within the comment handling mechanism associated with gallery items. This issue manifests as a Stored DOM-Based Cross-Site Scripting (XSS) vulnerability. Unlike reflected XSS where malicious scripts are executed immediately upon request, stored XSS involves persisting the malicious payload on the target server. In this context, an attacker injects arbitrary web scripts into the comment parameter of a gallery item. Because the plugin fails to adequately sanitize input or escape output when rendering these comments in certain configurations, the injected code becomes part of the page content served to other users.

The technical root cause is insufficient input sanitization and lack of proper output escaping within the plugin's handling of the comment field. When an attacker submits a comment containing malicious JavaScript, the system accepts this data without rigorous validation or encoding that would neutralize script execution capabilities. The vulnerability is particularly potent because it leverages the Document Object Model (DOM) for execution. This means the payload executes in the victim's browser environment rather than on the server side during initial processing. For exploitation to succeed, specific conditions must be met regarding the site configuration and workflow. The active lightbox setting must be configured as either Shutter or Shutter Reloaded. These themes interact with the gallery content in a way that allows the injected script to trigger when the page is rendered. Without this specific theme alignment, the payload may not execute despite being stored in the database.

The operational impact of this vulnerability is severe due to its persistence and potential for widespread compromise. Since the malicious code is stored on the server, it affects every user who views the compromised gallery item until the comment is removed or moderated out. This creates a persistent threat vector that does not require repeated interaction from the attacker after the initial injection. The requirement for unauthenticated access lowers the barrier to entry significantly, allowing any internet user with knowledge of the vulnerability to attempt exploitation without needing valid credentials. Once executed, the arbitrary web scripts can perform various malicious actions depending on what the payload is designed to do. Common outcomes include session hijacking through cookie theft, credential harvesting via fake login forms injected into the page, keylogging to capture sensitive information typed by visitors, or redirection to phishing sites.

The exploitation process involves a two-step workflow that introduces a slight delay but increases reliability and stealth. First, an unauthenticated attacker submits the malicious comment containing the XSS payload through the gallery's public-facing interface. Second, this comment enters WordPress's standard moderation queue. The vulnerability is only realized when the site administrator or moderator approves the comment. This approval step ensures that the payload becomes visible to other visitors in a trusted context. Because it appears as legitimate user content within an approved thread, victims are less likely to suspect foul play until after they have interacted with the page and potentially suffered data loss. The reliance on Shutter or Shutter Reloaded lightboxes means that administrators using different gallery themes may be unaffected by this specific vector, highlighting the importance of theme-specific vulnerability assessments.

Mitigation strategies must address both immediate remediation and long-term security posture improvements. The primary defense is to upgrade the NextGEN Gallery plugin to a version later than 4.5.4 where these sanitization and escaping issues have been resolved by the developers. If upgrading is not immediately possible, administrators should manually review all pending comments in the moderation queue for any suspicious content before approval. Additionally, implementing Content Security Policy headers can help mitigate the impact of successful XSS attacks by restricting the sources from which scripts are allowed to load or execute. Enabling strict input validation on custom fields and ensuring that output is consistently escaped using WordPress functions like wp_kses_post or esc_html can prevent similar issues in other plugins. Regular security audits and penetration testing focused on user input handling will help identify such flaws before they can be exploited by malicious actors.

From a classification perspective, this vulnerability aligns with CWE-79 Improper Neutralization of Input During Web Page Generation commonly known as Cross-site Scripting. The specific nature of the attack falls under ATT&CK technique T1059 Command and Scripting Interpreter when considering the execution phase, although the initial entry is better described by T1189 Drive-by Compromise or T1204 User Execution depending on how the victim interacts with the content. Understanding these mappings helps security teams categorize the risk accurately within their threat intelligence frameworks. The persistence of the payload in stored form distinguishes it from transient attacks, requiring ongoing monitoring and proactive defense mechanisms rather than one-time fixes. By addressing the input sanitization gaps and enforcing strict output escaping protocols, organizations can effectively neutralize this class of vulnerabilities across their WordPress infrastructure.

Responsible

Wordfence

Reservation

10/26/2026

Disclosure

10/31/2026

Moderation

accepted

EPSS

0.00000

KEV

no

Activities

low

Sources

Interested in the pricing of exploits?

See the underground prices here!