CVE-2024-47317
Executive Summary
CVE-2024-47317 is a Missing Authorization vulnerability (CWE-862) in the Ads by WPQuads WordPress plugin (formerly known as quick-adsense-reloaded). The flaw affects all versions up to and including 2.0.84. An unauthenticated attacker can exploit this vulnerability to perform unauthorized actions, such as modifying ad settings or injecting malicious ad code, without proper permission checks. The CVSS score is 4.3 (Medium), with a low impact on integrity but no impact on confidentiality or availability. No public proof-of-concept (PoC) or exploit code has been released, 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 resides in a WordPress plugin ecosystem. The plugin is distributed via the official WordPress plugin repository and third-party marketplaces. Users are advised to verify the integrity of their plugin files and monitor for any unauthorized modifications.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
- Base Score: 4.3 (Medium)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: None (PR:N)
- User Interaction: None (UI:N)
- Scope: Unchanged (S:U)
- Confidentiality Impact: None (C:N)
- Integrity Impact: Low (I:L)
- Availability Impact: None (A:N)
Threat Level: Medium. The vulnerability allows unauthorized modification of ad-related data, which could lead to defacement, malvertising, or data exfiltration via injected scripts.
Deep Dive & Mechanics
The vulnerability stems from a missing authorization check in one or more AJAX actions or REST API endpoints within the Ads by WPQuads plugin. The plugin likely exposes functions to save, update, or delete ad configurations without verifying that the requesting user has the appropriate capabilities (e.g., manage_options or edit_posts). An unauthenticated attacker can send crafted HTTP requests to these endpoints, bypassing access controls.
Root Cause: The plugin fails to call current_user_can() or similar WordPress capability checks before executing sensitive operations.
Attack Vector: The attacker sends a POST/GET request to a vulnerable endpoint (e.g., /wp-admin/admin-ajax.php?action=wpquads_save_ad) with malicious parameters. Since no authentication is required, the request is processed, leading to unauthorized changes.
Impact:
- Ad Injection: Attacker can inject arbitrary JavaScript or HTML into ad slots, leading to cross-site scripting (XSS) or malvertising.
- Configuration Tampering: Attacker can modify ad dimensions, targeting rules, or revenue settings.
- Data Exfiltration: Injected scripts can steal cookies, session tokens, or other sensitive data from site visitors.
Vulnerable vs. Patched Code
Since no official patch is available, the vulnerable code is presumed to be in the plugin's AJAX handlers. A typical vulnerable pattern:
Vulnerable Code (hypothetical):
add_action('wp_ajax_nopriv_wpquads_save_ad', 'wpquads_save_ad_callback');
function wpquads_save_ad_callback() {
// Missing capability check
$ad_data = $_POST['ad_data'];
update_option('wpquads_ad_settings', $ad_data);
wp_die();
}
Patched Code (hypothetical):
add_action('wp_ajax_nopriv_wpquads_save_ad', 'wpquads_save_ad_callback');
function wpquads_save_ad_callback() {
if (!current_user_can('manage_options')) {
wp_die('Unauthorized', 403);
}
$ad_data = $_POST['ad_data'];
update_option('wpquads_ad_settings', $ad_data);
wp_die();
}
The patch adds a current_user_can('manage_options') check to ensure only administrators can modify ad settings.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- Target WordPress site running Ads by WPQuads <= 2.0.84.
- Network access to the target.
Exploitation Steps:
- Identify the vulnerable endpoint by analyzing the plugin's JavaScript or source code. Common patterns include
wp_ajax_nopriv_*actions. - Craft a POST request to
wp-admin/admin-ajax.phpwith the action parameter set to the vulnerable function (e.g.,wpquads_save_ad). - Include malicious payload in the request body (e.g.,
ad_data[code]=<script>alert('XSS')</script>). - Send the request using
curlor a tool like Burp Suite.
Example curl command:
curl -X POST http://target.com/wp-admin/admin-ajax.php \
-d "action=wpquads_save_ad&ad_data[code]=<script>alert(document.cookie)</script>"
Expected Outcome: The malicious ad code is saved and executed when the ad is rendered on the site.
Blue Team (Detection & Defense)
Detection:
- Monitor for unusual POST requests to
/wp-admin/admin-ajax.phpwith action parameters related to WPQuads (e.g.,wpquads_*). - Look for requests from unauthenticated users (no valid WordPress nonce or cookie).
- Analyze server logs for 200 responses to AJAX actions that should require authentication.
Defense:
- Immediately update the plugin if a patch becomes available.
- Implement a Web Application Firewall (WAF) rule to block requests to
admin-ajax.phpfrom unauthenticated users unless explicitly whitelisted. - Use a security plugin (e.g., Wordfence) to enforce capability checks on AJAX actions.
- Disable the plugin if no patch is available and alternative ad management solutions exist.
Indicators of Compromise (IOCs)
- Network IOCs:
- POST requests to
/wp-admin/admin-ajax.phpwithaction=wpquads_*parameters from unknown IPs. - Unusual
ad_dataparameters containing JavaScript or base64-encoded payloads.
- POST requests to
- File IOCs:
- Modified
wp_optionstable entries containingwpquads_ad_settingswith unexpected values. - Presence of obfuscated JavaScript in ad slots.
- Modified
- Behavioral IOCs:
- Sudden appearance of pop-up ads or redirects on the site.
- Unauthorized changes to ad dimensions or targeting settings.
Detection Engineering
YARA Rule
rule CVE_2024_47317_WPQuads_Missing_Auth {
meta:
description = "Detects exploitation attempts of CVE-2024-47317 in Ads by WPQuads"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-47317"
strings:
$ajax_action = "wpquads_save_ad" nocase
$ajax_action2 = "wpquads_update_ad" nocase
$ajax_action3 = "wpquads_delete_ad" nocase
$payload = /<script[^>]*>.*<\/script>/i
condition:
any of ($ajax_action*) and $payload
}
Sigma Rule
title: CVE-2024-47317 WPQuads Missing Authorization Exploitation
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects unauthenticated POST requests to WPQuads AJAX endpoints
author: Valters IT
date: 2025/04/10
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: POST
cs-uri-query|contains:
- "action=wpquads_save_ad"
- "action=wpquads_update_ad"
- "action=wpquads_delete_ad"
sc-status: 200
condition: selection
falsepositives:
- Legitimate admin actions (should include nonce)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-47317 WPQuads Missing Authorization Exploitation"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/admin-ajax.php"; http_uri; content:"action=wpquads_save_ad"; http_client_body; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin if it is not critical to operations. This is the most effective mitigation until a patch is released.
- Apply a virtual patch using a WAF to block unauthenticated requests to WPQuads AJAX endpoints.
- Monitor logs for any signs of exploitation (see IOCs).
Long-term Fix:
- The vendor must release a patched version that adds proper capability checks (e.g.,
current_user_can('manage_options')) to all AJAX handlers. - Users should update to the latest version once available.
Workaround:
- Add the following code to the theme's
functions.phpto enforce authentication on WPQuads AJAX actions:
add_action('wp_ajax_nopriv_wpquads_save_ad', function() {
wp_die('Unauthorized', 403);
}, 1);
- Note: This may break legitimate functionality if the plugin relies on unauthenticated AJAX for front-end features.
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.