CVE-2026-2112

Dam Spam <= 1.0.8 - Cross-Site Request Forgery to Arbitrary Pending Comment Deletion

mediumCross-Site Request Forgery (CSRF)
4.3
CVSS Score
4.3
CVSS Score
medium
Severity
1.0.9
Patched in
1d
Time to patch

Description

The Dam Spam plugin for WordPress is vulnerable to Cross-Site Request Forgery in all versions up to, and including, 1.0.8. This is due to missing nonce verification on the pending comment deletion action in the cleanup page. This makes it possible for unauthenticated attackers to delete all pending comments via a forged request granted they can trick an admin into performing an action such as clicking on a link.

CVSS Vector Breakdown

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N
Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
None
Confidentiality
Low
Integrity
None
Availability

Technical Details

Affected versions<=1.0.8
PublishedFebruary 17, 2026
Last updatedFebruary 18, 2026
Affected plugindam-spam
Research Plan
Unverified

This plan outlines the research and exploitation strategy for **CVE-2026-2112**, a CSRF vulnerability in the "Dam Spam" WordPress plugin. ### 1. Vulnerability Summary The **Dam Spam** plugin (up to version 1.0.8) fails to implement nonce verification on its "cleanup" functionality. Specifically, th…

Show full research plan

This plan outlines the research and exploitation strategy for CVE-2026-2112, a CSRF vulnerability in the "Dam Spam" WordPress plugin.

1. Vulnerability Summary

The Dam Spam plugin (up to version 1.0.8) fails to implement nonce verification on its "cleanup" functionality. Specifically, the action responsible for deleting all pending comments does not check for a valid WordPress CSRF token (nonce). This allows an attacker to craft a malicious request that, when executed by a logged-in administrator (e.g., via a phishing link), triggers the bulk deletion of all comments currently in the "Pending" (moderation) queue.

2. Attack Vector Analysis

  • Endpoint: Likely an admin page processing logic (e.g., wp-admin/admin.php or wp-admin/admin-post.php).
  • Vulnerable Action: A parameter such as action, dam_spam_action, or a specific URL query variable used on the plugin's cleanup page.
  • Authentication Level: Requires an active session of a user with permissions to manage comments and access the plugin's settings (typically Administrator).
  • Preconditions: There must be pending comments in the database for the impact to be observable.
  • Vector: CSRF. The attacker tricks the admin into sending a GET or POST request to the target endpoint.

3. Code Flow (Inferred)

Since source files are not provided, the following flow is inferred based on standard WordPress plugin patterns for "Cleanup" or "Tools" pages:

  1. Registration: The plugin registers an admin page via add_menu_page or add_submenu_page with a slug (likely dam-spam or dam-spam-cleanup).
  2. Request Handling: The plugin uses a hook like admin_init or logic inside the menu callback function to check for a specific trigger parameter (e.g., if ( isset( $_GET['delete_pending'] ) )).
  3. The Sink: The code performs a database operation, likely using $wpdb->query to delete entries from the wp_comments table where comment_approved = '0'.
  4. The Vulnerability: The code lacks a call to check_admin_referer() or wp_verify_nonce() before executing the deletion query.

4. Nonce Acquisition Strategy

No nonce is required for this exploit.
The nature of the vulnerability is the absence of nonce verification. The attacker does not need to bypass a check; they simply need to know the correct parameters to trigger the action.

5. Exploitation Strategy

Step 1: Discovery (Locate the Action)

The agent must first identify the exact parameter and value used to trigger the deletion.

  1. Navigate to the plugin's settings/cleanup page.
  2. Inspect the "Delete Pending Comments" button or link.
  3. Identify if it is a GET request (link) or a POST request (form).

Step 2: Craft the Exploit

Based on the discovery, the agent will use the http_request tool to simulate a CSRF attack.

If GET-based (Likely):

  • URL: http://localhost:8080/wp-admin/admin.php?page=[SLUG]&action=[ACTION_VALUE]
  • Method: GET
  • Headers: Standard admin cookies (provided by the environment).

If POST-based:

  • URL: http://localhost:8080/wp-admin/admin.php?page=[SLUG] (or admin-post.php)
  • Method: POST
  • Content-Type: application/x-www-form-urlencoded
  • Body: action=[ACTION_VALUE]&other_params=...

Step 3: Execute

Trigger the request while authenticated as the Administrator.

6. Test Data Setup

To demonstrate the vulnerability, the environment must contain pending comments:

  1. Create Pending Comments: Use WP-CLI to generate dummy comments in the "hold" status.
    wp comment create --comment_post_ID=1 --comment_content="Spam Comment 1" --comment_approved=0
    wp comment create --comment_post_ID=1 --comment_content="Spam Comment 2" --comment_approved=0
    
  2. Verify Setup:
    wp comment list --status=hold
    

7. Expected Results

  • Response: A 302 redirect back to the cleanup page or a success message.
  • State Change: The database table wp_comments should no longer contain any rows with comment_approved = '0'.
  • Log: If WP_DEBUG is on, no "headers already sent" or nonce errors should appear during the process.

8. Verification Steps

After sending the malicious HTTP request, verify the deletion via WP-CLI:

# This should return an empty list or a count of 0
wp comment list --status=hold --count

If the count is 0 and the comments existed previously, the CSRF is confirmed.

9. Alternative Approaches

If the plugin uses a custom AJAX handler for the cleanup (less common for "cleanup" pages but possible):

  • Endpoint: wp-admin/admin-ajax.php
  • Action: Look for wp_ajax_dam_spam_cleanup in the source code.
  • Verification: Perform the POST request to admin-ajax.php with the action parameter but without a security or _wpnonce parameter. If the comments are deleted, the vulnerability is confirmed.

Grep Commands for Initial Analysis

The agent should run these to ground the plan in the actual source:

# Find the cleanup action string
grep -r "DELETE" wp-content/plugins/dam-spam/
grep -r "comment_approved" wp-content/plugins/dam-spam/

# Find the admin page registration to get the slug
grep -r "add_menu_page" wp-content/plugins/dam-spam/
grep -r "add_submenu_page" wp-content/plugins/dam-spam/

# Check for missing nonces in the identified file
grep -L "nonce" [IDENTIFIED_FILE].php
Research Findings
Static analysis — not yet PoC-verified

Summary

The Dam Spam plugin for WordPress fails to perform nonce verification when processing the bulk deletion of pending comments. This allows an unauthenticated attacker to delete all comments awaiting moderation by tricking a logged-in administrator into clicking a malicious link.

Vulnerable Code

// Inferred logic based on plugin functionality in wp-content/plugins/dam-spam/dam-spam.php or similar admin-handling file

if ( isset( $_GET['delete_pending'] ) ) {
    global $wpdb;
    $wpdb->query( "DELETE FROM $wpdb->comments WHERE comment_approved = '0'" );
    // Redirect or display success message follows without nonce check
}

Security Fix

--- wp-content/plugins/dam-spam/dam-spam.php
+++ wp-content/plugins/dam-spam/dam-spam.php
@@ -10,4 +10,5 @@
 
 if ( isset( $_GET['delete_pending'] ) ) {
+    check_admin_referer( 'dam_spam_cleanup_action' );
     global $wpdb;
     $wpdb->query( "DELETE FROM $wpdb->comments WHERE comment_approved = '0'" );

Exploit Outline

1. The attacker identifies the administrative URL and parameter used by the plugin to trigger the 'Delete Pending' action (e.g., /wp-admin/admin.php?page=dam-spam-cleanup&delete_pending=1). 2. The attacker crafts a malicious GET request targeting this URL. 3. The attacker tricks a logged-in WordPress administrator into clicking a link containing this URL or visiting a site that performs the request automatically (e.g., via an <img> tag or window.location). 4. Because the plugin does not verify a cryptographic nonce (CSRF token), the WordPress site processes the request as legitimate, executing the database query to delete all rows in the comments table with a status of '0' (Pending).

Check if your site is affected.

Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.