Skip to content
Laskyr

CVE-2026-74921: Document Gallery cross-site scripting (XSS) vulnerability

medium 6.8 published 2026-10-19

Fixed in Document Gallery 5.1.2 (first release after the affected range)

Document Gallery 4.0 to 5.1.1 is affected by this XSS issue. Sites on 5.1.2 or newer are not affected; the latest release is 5.1.2.

Affected versions
4.0 to 5.1.1
Fixed in
5.1.2 *
Latest version
5.1.2
Severity
Medium · CVSS 6.8
Active installs
8,000+
Type
Cross-site scripting (XSS)

* The source does not name a fixed version; this is the first wordpress.org release after the last affected version.

What an attacker needs

CVSS vector (score by WPScan): CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:H

What to do now

  1. Update Document Gallery to 5.1.2 or newer: Dashboard → Updates, or Plugins → “update now”.
  2. If you cannot update right away, deactivate it until you can.
  3. Turn on auto-updates for it: Plugins → “Enable auto-updates” on its row.
  4. Not sure which version you run? Check your version against every known Document Gallery issue. With WP-CLI: wp plugin get document-gallery --field=version.
  5. If you ran an affected version and something looks off (new admin users, spam pages, redirects), run the free scan below.

The advisory

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.

Description from the CVE record, published by WPScan (the CVE Numbering Authority), via the NVD entry for CVE-2026-74921.

References

Related

Ran an affected version? Check your site for signs of a hack

The free scan reads the public side of your site and looks for spam pages, hidden redirects, injected scripts and blacklist entries. No login, no install, about a minute.

Where this data comes from

First hour checklist

If the site was just hacked, read the emergency kit before you delete files. The page is free. Email is optional.

Read the emergency kit