# Lightbox with PhotoSwipe <= 5.18.0 - Authenticated (Contributor+) Stored Cross-Site Scripting via Image Caption Attributes

- **ID:** WPSEC-2026-2849
- **Plugin:** Lightbox with PhotoSwipe (`lightbox-photoswipe`), https://wordpress.org/plugins/lightbox-photoswipe/
- **Affected versions:** from 5.9.0 before 5.19.0
- **Fixed in:** 5.19.0 (Update to 5.19.0 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-12)
- **Attack surface analysis:** https://attacksurface.wpsec.com/plugin/lightbox-photoswipe
- **Fix released:** 2026-11-11
- **Published:** 2026-11-12
- **URL:** https://wpsec.com/vuln/WPSEC-2026-2849/

## Description

The Lightbox with PhotoSwipe plugin for WordPress is vulnerable to Stored Cross-Site Scripting via image caption sources (such as the data-lbwps-caption, data-lbwps-title, data-lbwps-description and data-lbwps-filename link attributes, the title and alt attributes, and figcaption content) in versions 5.9.0 up to, and including, 5.18.0. This is due to insufficient input sanitization in the frontend caption handling: a regular-expression filter removes only complete disallowed tags, so unterminated tags and, in later versions, anchor tags with javascript: URLs pass through, and the result is inserted into the lightbox as HTML. This makes it possible for authenticated attackers, with contributor-level access and above, to inject arbitrary web scripts that execute when a user opens the image in the lightbox.

## References

- https://wpsec.com/vuln/WPSEC-2026-2849/
- https://plugins.svn.wordpress.org/lightbox-photoswipe/tags/5.19.0/
- https://wordpress.org/plugins/lightbox-photoswipe/

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

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.
