Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-84919 Overview
CVE-2026-84919 is a stored cross-site scripting (XSS) vulnerability in the Drupal PhotoSwipe - Responsive JavaScript Modal Image Gallery module. The flaw stems from improper neutralization of input during web page generation [CWE-79]. Attackers with content creation privileges can inject malicious JavaScript that executes in the browser context of any user viewing the affected gallery content. The vulnerability affects PhotoSwipe module versions 0.0.0 through 5.0.9.
Critical Impact
Stored XSS enables session hijacking, credential theft, and administrative account takeover when privileged users render content containing injected payloads.
Affected Products
- Drupal PhotoSwipe - Responsive JavaScript Modal Image Gallery module
- Versions 0.0.0 through 5.0.9
- Drupal sites that have installed and enabled the PhotoSwipe contributed module
Discovery Timeline
- 2026-10-22 - CVE-2026-84919 published to NVD
- 2026-10-22 - Last updated in NVD database
Technical Details for CVE-2026-84919
Vulnerability Analysis
The PhotoSwipe module renders user-supplied content such as image captions, titles, or alt text within the gallery markup. The module fails to apply sufficient output encoding before injecting these values into the Document Object Model (DOM). An attacker with permission to create or edit gallery content can embed JavaScript within these fields. When another user loads a page containing the affected gallery, the injected script executes in their browser session.
Stored XSS vulnerabilities carry higher operational risk than reflected variants because the payload persists in the application database. Each visitor to the affected page triggers execution without additional attacker interaction. See the Drupal Security Advisory SA-CORE-2026-131 for vendor technical details.
Root Cause
The root cause is missing or inadequate neutralization of HTML control characters in fields rendered by the PhotoSwipe module. Drupal provides sanitization APIs such as Html::escape() and the Twig auto-escaping engine, but the vulnerable code paths bypass or misuse these mechanisms. The condition maps to CWE-79, Improper Neutralization of Input During Web Page Generation.
Attack Vector
Exploitation requires an authenticated account with permission to create or modify PhotoSwipe gallery content. The attacker injects a JavaScript payload into a captioned or titled image field. The payload is stored in the Drupal database. When any user loads the rendered gallery page, the browser parses and executes the attacker-controlled script under the site origin. This enables cookie theft, forced actions via the Drupal administrative interface, and defacement.
No verified exploit code is publicly available. The vulnerability mechanism is described in prose per the referenced Drupal security advisory.
Detection Methods for CVE-2026-84919
Indicators of Compromise
- Gallery content fields containing <script> tags, javascript: URIs, or event handlers such as onerror= and onload=
- Unexpected outbound requests from browser sessions of authenticated Drupal users to attacker-controlled domains
- New or modified administrative accounts created shortly after privileged users viewed gallery pages
Detection Strategies
- Query the Drupal database for image caption, title, and alt-text fields containing HTML tags or JavaScript protocol handlers
- Review web server access logs for suspicious POST requests to node edit endpoints by low-privilege content editor accounts
- Enable Content Security Policy (CSP) reporting to capture script execution violations originating from gallery pages
Monitoring Recommendations
- Monitor Drupal watchdog logs for unusual node creation or revision events on content types that embed PhotoSwipe galleries
- Alert on authentication events from administrative accounts that occur immediately after viewing user-generated gallery content
- Track module version inventory to confirm all PhotoSwipe installations are above 5.0.9
How to Mitigate CVE-2026-84919
Immediate Actions Required
- Upgrade the PhotoSwipe module to the fixed version published in Drupal Security Advisory SA-CORE-2026-131
- Audit existing gallery content for stored payloads and remove or sanitize any suspicious entries
- Restrict the Drupal permission that allows creating or editing PhotoSwipe gallery content to trusted roles only
Patch Information
Refer to the Drupal Security Advisory SA-CORE-2026-131 for the fixed release version and upgrade guidance. Apply the update through Drupal's standard module update workflow using Composer or the administrative interface.
Workarounds
- Disable the PhotoSwipe module until the patched version can be deployed
- Implement a strict Content Security Policy that blocks inline script execution on pages rendering gallery content
- Temporarily revoke content creation permissions on PhotoSwipe-enabled content types for non-administrative roles
# Update the PhotoSwipe module via Composer
composer update drupal/photoswipe --with-dependencies
drush updatedb
drush cache:rebuild
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

