Skip to main content

CVE-2025-6068: FooGallery WordPress Plugin XSS Vulnerability

CVE-2025-6068 is a stored cross-site scripting vulnerability in FooGallery WordPress plugin that lets authenticated attackers inject malicious scripts. This article covers the technical details, affected versions, and mitigation.

Published:

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-2025-6068 Overview

CVE-2025-6068 is a Stored Cross-Site Scripting (XSS) vulnerability in the FooGallery WordPress plugin by fooplugins. The flaw affects the data-caption-title and data-caption-description HTML attributes in all versions up to and including 2.4.31. Insufficient input sanitization and output escaping allow authenticated attackers with Contributor-level access or higher to inject arbitrary JavaScript. Injected scripts execute in the browser of any user who visits an affected page. The vulnerability is categorized under CWE-79.

Critical Impact

Authenticated contributors can inject persistent JavaScript that executes against site visitors and administrators, enabling session theft, forced actions, and content tampering.

Affected Products

  • FooGallery – Responsive Photo Gallery, Image Viewer, Justified, Masonry & Carousel plugin for WordPress
  • All versions up to and including 2.4.31
  • Deployments where Contributor-level or higher accounts exist

Discovery Timeline

  • 2025-07-11 - CVE-2025-6068 published to the National Vulnerability Database
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2025-6068

Vulnerability Analysis

The vulnerability lives in how FooGallery renders caption metadata into gallery markup. The plugin accepts caption titles and descriptions from authenticated users and stores them in post content. When a gallery is rendered, those values are placed into the data-caption-title and data-caption-description HTML attributes without adequate escaping.

Because the stored values are not properly sanitized on input or escaped on output, an attacker can break out of the attribute context. Injected payloads execute whenever a visitor loads a page containing the manipulated gallery. The scope change in the CVSS vector reflects that script execution occurs in the browser context of other users, including administrators.

The impact depends on which user triggers the payload. Script execution in an administrator session can lead to privileged actions such as creating accounts, modifying plugin settings, or planting additional backdoors through the WordPress REST API.

Root Cause

The root cause is missing output escaping for HTML attribute context. WordPress provides helpers such as esc_attr() that encode characters including ", ', <, >, and &. FooGallery's caption rendering did not consistently apply attribute escaping before emitting the values inside data-* attributes, allowing attacker-supplied markup to terminate the attribute and introduce event handlers or inline script.

Attack Vector

Exploitation requires an authenticated account with Contributor privileges or higher. The attacker crafts a gallery item with a caption title or description containing an attribute-breaking payload, then saves the post. Any user who later views the page executes the injected script. User interaction is required to trigger the payload. See the Wordfence vulnerability analysis for additional detail.

No verified proof-of-concept code is published for this issue. The vulnerable rendering path can be reviewed in the FooGallery JavaScript source.

Detection Methods for CVE-2025-6068

Indicators of Compromise

  • Gallery captions containing HTML entities, angle brackets, or event handlers such as onerror=, onload=, or onmouseover=
  • Unexpected <script> tags, javascript: URIs, or encoded payloads within postmeta records tied to FooGallery
  • New administrator accounts or plugin changes correlated with contributor-authored posts
  • Outbound requests from editor sessions to unfamiliar domains after viewing gallery pages

Detection Strategies

  • Query the WordPress database for data-caption-title and data-caption-description values containing <, ", on event prefixes, or javascript:
  • Review Contributor and Author account activity for recently created or edited gallery posts
  • Enable WordPress audit logging to track post_meta changes performed by lower-privileged roles

Monitoring Recommendations

  • Inspect web server logs for POST requests to /wp-admin/post.php and /wp-json/wp/v2/ endpoints originating from non-trusted roles
  • Deploy a Content Security Policy (CSP) with script-src restrictions and monitor CSP violation reports
  • Alert on administrator sessions that execute privileged REST API calls immediately after loading a public gallery page

How to Mitigate CVE-2025-6068

Immediate Actions Required

  • Update FooGallery to a version later than 2.4.31 that includes the sanitization fix referenced in the plugin changeset
  • Audit all existing galleries for caption content containing HTML or JavaScript artifacts
  • Review Contributor-level and above accounts and remove or reset any that are unused or suspicious

Patch Information

Fooplugins addressed the vulnerability in the FooGallery plugin changeset 3322251. The fix enforces sanitization and escaping on the data-caption-title and data-caption-description attributes. Administrators should update through the WordPress plugin manager or by downloading the latest release from the plugin repository.

Workarounds

  • Restrict post publishing to Editor and Administrator roles until the plugin is updated
  • Temporarily deactivate FooGallery on sites that cannot be patched immediately
  • Deploy a web application firewall rule that blocks HTML tag characters in gallery caption fields
  • Enforce a strict Content Security Policy that disallows inline scripts and untrusted event handlers
bash
# Update FooGallery via WP-CLI
wp plugin update foogallery

# Verify installed version is patched
wp plugin get foogallery --field=version

# Audit postmeta for suspicious caption content
wp db query "SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE meta_value LIKE '%<script%' OR meta_value LIKE '%onerror=%';"

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

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.