MEDIUM 6.4

CVE-2026-9134: FooGallery WordPress Plugin Stored XSS Vulnerability

The FooGallery WordPress plugin contains a vulnerability that allows contributors and higher-privileged users to inject malicious JavaScript code into pages. The plugin's sanitization function blocks only some HTML event handlers (like onclick and onload) but misses others like onmouseenter. When a visitor views an affected page, the injected script runs in their browser without their knowledge, potentially compromising their session or stealing information.

Source data · NVD / CISA · public domain

CVSS
3.1 · 6.4 MEDIUM · CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
Weaknesses (CWE)
CWE-79
Affected products
0 configuration(s)
Published / Modified
2026-06-13 / 2026-06-17

NVD description (verbatim)

The FooGallery plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the 'custom_attribute_key' shortcode parameter in versions up to, and including, 3.1.31 This is due to an incomplete JavaScript event handler blacklist in the foogallery_sanitize_javascript() function, which blocks only a subset of HTML event attributes (onmouseover, onmouseout, onpointerenter, onclick, onload, onchange, onerror) while permitting others such as 'onmouseenter', combined with the failure to escape the attribute key when building the gallery container HTML in foogallery_build_container_attributes_safe(). This makes it possible for authenticated attackers, with contributor-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.

5 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

CVE-2026-9134 is a Stored XSS flaw in FooGallery versions up to 3.1.31. The vulnerability stems from two design flaws in the shortcode processing: (1) the foogallery_sanitize_javascript() function implements an incomplete blocklist of HTML event attributes, allowing onmouseenter and similar handlers to bypass filtering; and (2) the foogallery_build_container_attributes_safe() function fails to properly escape attribute keys when constructing gallery container HTML. An authenticated attacker with contributor-level or higher permissions can craft a malicious shortcode with a custom_attribute_key parameter containing event handler markup. Because the unsafe attribute key is directly inserted into the HTML output and stored in the database, the payload persists and executes whenever any user visits the affected page.

Business impact

Organizations relying on FooGallery risk content compromise and user trust degradation. Attackers with contributor access—a common privilege level for content teams—can silently inject credential-harvesting payloads, malware redirects, or keyloggers into published pages. This affects visitor trust, potential regulatory exposure if user data is compromised, and operational overhead in incident response and content remediation.

Affected systems

FooGallery WordPress plugin version 3.1.31 and earlier are affected. The vulnerability requires an authenticated attacker with at least contributor-level access, meaning WordPress users with the ability to create or edit posts and pages can exploit this flaw. Sites running FooGallery for image galleries are in scope if they grant contributor roles to multiple team members or third-party content creators.

Exploitability

Exploitation requires valid WordPress credentials at contributor level or above—a relatively low bar in multi-author environments. No network-level interaction or complex social engineering is needed; an attacker can inject the payload directly via the WordPress admin interface. Once stored, the payload executes automatically for all site visitors, amplifying impact without requiring re-exploitation. The incomplete event handler blocklist suggests the developers attempted sanitization but did not account for the full range of HTML event attributes, making the bypass straightforward for someone familiar with event-driven JavaScript.

Remediation

Update FooGallery to a patched version after 3.1.31 (verify against the vendor advisory for the specific release that addresses this flaw). Additionally, audit contributor-level permissions across your WordPress installation and restrict the ability to create or edit posts containing FooGallery shortcodes to trusted personnel only. For WordPress sites where FooGallery is not actively used, deactivate and remove the plugin.

Patch guidance

Patching is the primary remediation. Check the FooGallery release notes and security advisories on the plugin's official repository or vendor website for the first version after 3.1.31 that includes a fix. The fix should both complete the event handler blocklist in sanitization logic and ensure proper HTML escaping of attribute keys. Update via the WordPress admin dashboard or directly download from the official plugin source. After updating, verify that no malicious shortcodes remain in your posts and pages (use the WordPress plugin search or database queries to find instances of custom_attribute_key parameters).

Detection guidance

Search your WordPress database for posts and pages containing FooGallery shortcodes with suspicious custom_attribute_key parameters, especially those containing 'on' prefixes followed by event names (onmouseenter, onmousemove, onwheel, etc.). Use WordPress audit logs or security plugins (e.g., Wordfence, Sucuri) to identify post revisions created by contributor-level users around the time of suspected compromise. Monitor browser console logs and network traffic on affected pages for unexpected JavaScript execution. Review access logs for unusual patterns of contributor account activity.

Why prioritize this

Although listed as MEDIUM severity (CVSS 6.4), the practical risk is significant in multi-author WordPress environments. The vulnerability combines persistent stored XSS (high impact) with relatively permissive access requirements (authenticated, contributor-level). Unlike a reflected XSS that requires social engineering, this flaw allows any trusted contributor to silently compromise pages viewed by thousands of visitors. Organizations should prioritize patching contributor-accessible plugins within their standard maintenance windows.

Risk score, explained

The CVSS 3.1 score of 6.4 reflects network-accessible attack vector (AV:N), low complexity (AC:L), and low privilege requirement (PR:L), balanced against limited confidentiality and integrity impact (C:L, I:L) and no availability impact (A:N). The score appropriately captures the cross-site (S:C) nature of the attack but may underweight the practical persistence and user-facing consequences of stored XSS in a CMS context. For risk prioritization, consider raising the internal priority if your WordPress installation grants contributor roles broadly or hosts sensitive content.

Frequently asked questions

Can unauthenticated visitors exploit this vulnerability?

No. An attacker must have valid WordPress login credentials with at least contributor-level permissions to inject the malicious shortcode. However, once injected and stored, the payload executes for all visitors, including unauthenticated ones.

What happens if we remove the FooGallery plugin?

Removing the plugin will prevent new exploits but will not automatically clean up existing malicious shortcodes in your posts and pages. You must audit and manually remove or repair any compromised content. If you rely on FooGallery, update to a patched version instead of removing it.

Does this affect other WordPress gallery plugins?

No, this vulnerability is specific to FooGallery's sanitization and escaping logic. Other gallery plugins are not affected unless they have similar flaws in their own code.

How do I check if my site has been exploited?

Search your WordPress database for FooGallery shortcodes containing suspicious event handlers. Review post edit history to identify when malicious shortcodes were added and by which user. Use a WordPress security plugin to scan for injected scripts in post content. If you find compromise evidence, change all contributor and higher-level user passwords immediately and investigate access logs.

This analysis is provided for informational purposes and reflects publicly available vulnerability data as of the publication date. Patch availability, affected versions, and vendor guidance may change; verify all remediation steps against the official FooGallery security advisory and your vendor's recommendations. SEC.co does not provide legal or compliance advice. Organizations should assess their own risk based on deployment context, data sensitivity, and access controls. No exploit code or proof-of-concept is provided in this advisory. Source: NVD (public-domain), retrieved 2026-07-20. Analysis generated by SEC.co (claude-haiku-4-5).