---
id: "CVE-2026-74921"
kind: "vulnerability"
aliases: ["CVE-2026-74921"]
title: "WordPress Document Gallery plugin: shortcode attributes allow stored XSS"
severity: "medium"
cvss: 6.8
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["package", "self-hosted", "wordpress", "wordpress-plugins"]
not_affected_if: ["only-administrators-write-content", "plugin-not-installed"]
published_at: "2026-10-19T07:16:31+00:00"
first_seen_at: "2026-10-23T21:57:17+00:00"
updated_at: "2026-10-25T03:44:53+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-74921", "first_seen_at": "2026-10-23T21:57:17+00:00"}]
---

# WordPress Document Gallery plugin: shortcode attributes allow stored XSS

The Document Gallery WordPress plugin through 5.1.1 does not sanitise or escape several gallery shortcode attributes before writing them into HTML. A contributor-level user can inject event handlers that run in the browser of a higher-privileged user who views the page.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the installed version of the Document Gallery plugin in the WordPress admin plugins list or `wp plugin get document-gallery --field=version`
- Look for the plugin's gallery shortcode in posts and pages that contributors can edit
- Confirm which accounts hold the Contributor role or above on the site

## Fix

- Update the Document Gallery plugin to a version later than `5.1.1`, if the vendor has released one (unknown from the sources)
- Until patched, restrict Contributor and above accounts or remove the plugin's gallery shortcode

## Timeline

- 2026-10-23T21:57:17+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-74921

## From the sources

The Document Gallery WordPress plugin through 5.1.1 does not sanitise or escape several gallery shortcode attributes before embedding them in a single-quoted HTML attribute in the rendered gallery markup, allowing users with the Contributor role and above to inject arbitrary event handlers that execute when a higher privileged user views the content.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
