Skip to main content
Vulnerability Database/CVE-2025-22518

CVE-2025-22518: Justified Image Gallery Stored XSS Vulnerability

CVE-2025-22518 is a stored XSS vulnerability in the Justified Image Gallery WordPress plugin that allows attackers to inject malicious scripts. This article covers technical details, affected versions, and mitigation strategies.

Published:

CVE-2025-22518 Overview

CVE-2025-22518 is a stored Cross-Site Scripting (XSS) vulnerability in the PluginsPoint Justified Image Gallery plugin for WordPress. The flaw stems from improper neutralization of user-supplied input during web page generation [CWE-79]. Attackers with low-privilege authenticated access can inject malicious scripts that persist in the application and execute in the browsers of users who view affected pages. The vulnerability affects Justified Image Gallery versions up to and including 1.0.

Critical Impact

Authenticated attackers can inject persistent JavaScript payloads that execute in visitor and administrator sessions, enabling session theft, credential harvesting, and administrative account takeover through scope-changing script execution.

Affected Products

  • PluginsPoint Justified Image Gallery WordPress plugin
  • All versions from initial release through 1.0
  • WordPress sites using the justified-image-gallery plugin

Discovery Timeline

  • 2025-01-07 - CVE-2025-22518 published to NVD
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2025-22518

Vulnerability Analysis

The Justified Image Gallery plugin fails to properly sanitize and escape user-supplied input before rendering it in generated web pages. This omission allows attackers to store malicious JavaScript payloads within plugin data structures. When a user loads a page containing the tainted gallery output, the browser parses and executes the injected script under the site's origin.

Stored XSS carries higher risk than reflected variants because the payload persists server-side and executes for every visitor. The scope-changing nature of this vulnerability, as reflected in its CVSS metrics, means injected scripts can affect resources beyond the vulnerable component, including administrative interfaces.

Root Cause

The root cause is missing output encoding and input validation in code paths that accept gallery configuration or content data. WordPress provides sanitization functions such as sanitize_text_field(), wp_kses_post(), and escaping helpers like esc_html() and esc_attr(). The plugin does not consistently apply these functions to attacker-controlled fields before storing them or emitting them into HTML.

Attack Vector

Exploitation requires an authenticated user with low privileges, such as a contributor or editor, and requires an administrator or other visitor to view the tainted page. The attacker submits a gallery entry containing an HTML or JavaScript payload through the plugin's input fields. When another user loads the affected page, the browser executes the payload in the context of the WordPress site.

The attack does not require code examples to demonstrate. The vulnerability manifests when standard XSS payloads placed in unsanitized plugin fields render unencoded into the DOM. Refer to the Patchstack WordPress Vulnerability Advisory for advisory details.

Detection Methods for CVE-2025-22518

Indicators of Compromise

  • Unexpected <script>, onerror, onload, or javascript: strings in WordPress wp_options, wp_postmeta, or plugin-specific tables tied to gallery configuration.
  • Outbound HTTP requests from browser sessions to unfamiliar domains shortly after loading gallery-enabled pages.
  • New administrator accounts, altered user roles, or unexpected plugin installations following contributor or editor activity.

Detection Strategies

  • Audit the WordPress database for gallery entries containing HTML tags, event handlers, or encoded script fragments.
  • Enable a web application firewall (WAF) rule set that inspects POST requests to wp-admin/admin-ajax.php and plugin endpoints for XSS payloads.
  • Review WordPress access and audit logs for low-privilege accounts submitting or editing gallery content followed by administrator page views.

Monitoring Recommendations

  • Monitor Content Security Policy (CSP) violation reports for inline script executions on pages that render galleries.
  • Track file integrity and database change events for plugin tables, and alert on anomalous writes.
  • Correlate WordPress authentication events with subsequent privilege changes to identify session hijacking outcomes.

How to Mitigate CVE-2025-22518

Immediate Actions Required

  • Deactivate and remove the Justified Image Gallery plugin from WordPress installations until a patched version is confirmed available.
  • Audit all existing gallery entries in the database and remove any records containing HTML or script content.
  • Rotate credentials for administrator and editor accounts, and invalidate active WordPress sessions.

Patch Information

No vendor patch is referenced in the available advisory data. Version 1.0 and all prior releases are affected. Monitor the Patchstack advisory for updates on remediation status from PluginsPoint.

Workarounds

  • Restrict contributor and editor account creation, and limit plugin usage to trusted administrators only.
  • Deploy a Content Security Policy that disallows inline scripts and restricts script sources to trusted origins.
  • Place a WordPress-aware WAF in front of the site to filter XSS payloads submitted to plugin endpoints.
  • Replace the plugin with a maintained gallery alternative that follows current WordPress sanitization standards.

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

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.