CVE-2024-10390
Executive Summary
CVE-2024-10390 is a medium-severity vulnerability affecting the Elfsight Telegram Chat CC plugin for WordPress up to version 1.1.0. The flaw resides in the updatePreferences function, which lacks a proper capability check, allowing authenticated attackers with subscriber-level access or higher to inject arbitrary web scripts (stored XSS). This can lead to session hijacking, defacement, or redirection of users who visit compromised pages. The vulnerability is within the WordPress plugin ecosystem and does not affect the core WordPress or server software.
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
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 (Subscriber)
- User Interaction: None
- Scope: Changed (affects other components)
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: None
The threat level is elevated due to the low privilege requirement and the ability to execute scripts in the context of other users, potentially leading to broader compromise.
Deep Dive & Mechanics
The vulnerability is a classic Missing Authorization (CWE-862) combined with Stored Cross-Site Scripting (CWE-79). The updatePreferences AJAX action in the Elfsight Telegram Chat CC plugin does not verify that the current user has the necessary capabilities (e.g., edit_posts or manage_options) before processing the request. An attacker with subscriber-level access can craft a request to update preferences with malicious JavaScript payloads. These payloads are stored in the WordPress database and executed when any user (including administrators) views a page that loads the plugin’s settings or chat interface.
The attack flow:
- Attacker logs in as a subscriber.
- Sends a POST request to
/wp-admin/admin-ajax.phpwith actionupdatePreferencesand a malicious payload in thepreferencesparameter. - The plugin stores the payload without sanitization.
- When an admin or other user visits a page that renders the plugin, the script executes in their browser.
Vulnerable vs. Patched Code
Vulnerable Code (<= 1.1.0):
add_action('wp_ajax_updatePreferences', 'updatePreferences');
function updatePreferences() {
$preferences = $_POST['preferences'];
update_option('elfsight_telegram_chat_preferences', $preferences);
wp_send_json_success();
}
The function lacks a current_user_can() check.
Patched Code (Hypothetical):
add_action('wp_ajax_updatePreferences', 'updatePreferences');
function updatePreferences() {
if (!current_user_can('manage_options')) {
wp_die('Unauthorized', 403);
}
$preferences = sanitize_text_field($_POST['preferences']);
update_option('elfsight_telegram_chat_preferences', $preferences);
wp_send_json_success();
}
The patch adds a capability check and input sanitization.
Exploitation & Lab Setup
Red Team (Exploitation):
- Prerequisites: Valid subscriber account on a WordPress site with the vulnerable plugin.
- Craft Payload: Create a JavaScript payload (e.g.,
<script>alert('XSS')</script>). - Send Request:
curl -X POST http://target.com/wp-admin/admin-ajax.php \ -d "action=updatePreferences&preferences=<script>alert('XSS')</script>" \ --cookie "wordpress_logged_in_xxx=..." - Trigger: Visit any page that loads the plugin’s chat interface.
Blue Team (Detection & Response):
- Monitor AJAX requests to
admin-ajax.phpwith actionupdatePreferencesfrom low-privilege users. - Look for unusual
preferencesparameters containing HTML/JavaScript. - Review WordPress options table for unexpected values in
elfsight_telegram_chat_preferences.
Indicators of Compromise (IOCs)
- Network: POST requests to
/wp-admin/admin-ajax.phpwithaction=updatePreferencesandpreferencescontaining<script>tags. - Host: WordPress options table entry
elfsight_telegram_chat_preferencescontaining malicious JavaScript. - Logs: WordPress debug log entries showing unauthorized AJAX calls from subscriber roles.
Detection Engineering
YARA Rule:
rule detect_elfsight_xss_payload {
meta:
description = "Detects stored XSS payload in Elfsight Telegram Chat preferences"
author = "Valters IT"
date = "2024-10-27"
strings:
$payload = /<script[^>]*>.*<\/script>/i
$option = "elfsight_telegram_chat_preferences"
condition:
$option and $payload
}
Sigma Rule:
title: Elfsight Telegram Chat CC Stored XSS via updatePreferences
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects unauthorized AJAX requests to updatePreferences with script payloads
logsource:
category: webserver
product: wordpress
detection:
selection:
cs-method: POST
cs-uri-query|contains: admin-ajax.php
cs-uri-query|contains: action=updatePreferences
cs-uri-query|contains: <script
condition: selection
falsepositives:
- Legitimate plugin updates (unlikely)
level: high
Suricata Rule:
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"Elfsight Telegram Chat CC Stored XSS Attempt";
flow:to_server,established;
content:"POST"; http_method;
content:"admin-ajax.php"; http_uri;
content:"action=updatePreferences"; http_client_body;
content:"<script"; http_client_body;
sid:1000001;
rev:1;
)
Remediation & Mitigation
- Immediate: Disable the Elfsight Telegram Chat CC plugin until a patch is available.
- Short-term: Implement a Web Application Firewall (WAF) rule to block
updatePreferencesrequests containing<script>tags. - Long-term: Apply the vendor patch when released, or manually add capability checks and input sanitization to the plugin code.
- User Education: Ensure all WordPress users, especially subscribers, are aware of the risks of XSS.
Valters IT
Securing WordPress Ecosystems
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.