CVE-2026-24521

Kama Thumbnail <= 3.5.1 - Cross-Site Request Forgery

mediumCross-Site Request Forgery (CSRF)
4.3
CVSS Score
4.3
CVSS Score
medium
Severity
Unpatched
Patched in
N/A
Time to patch

Description

The Kama Thumbnail plugin for WordPress is vulnerable to Cross-Site Request Forgery in versions up to, and including, 3.5.1. This is due to missing or incorrect nonce validation on a function. This makes it possible for unauthenticated attackers to perform an unauthorized action via a forged request granted they can trick a site administrator 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<=3.5.1
PublishedJanuary 26, 2026
Last updatedFebruary 2, 2026
Affected pluginkama-thumbnail
Research Plan
Unverified

This plan outlines the research and exploitation strategy for **CVE-2026-24521**, a Cross-Site Request Forgery (CSRF) vulnerability in the **Kama Thumbnail** WordPress plugin (versions <= 3.5.1). --- ### 1. Vulnerability Summary The **Kama Thumbnail** plugin fails to implement or correctly verify …

Show full research plan

This plan outlines the research and exploitation strategy for CVE-2026-24521, a Cross-Site Request Forgery (CSRF) vulnerability in the Kama Thumbnail WordPress plugin (versions <= 3.5.1).


1. Vulnerability Summary

The Kama Thumbnail plugin fails to implement or correctly verify WordPress nonces in one of its administrative action handlers. This allows an unauthenticated attacker to trick a logged-in administrator into performing state-changing actions, such as updating plugin settings or clearing thumbnail caches, by visiting a malicious webpage.

2. Attack Vector Analysis

  • Endpoint: /wp-admin/admin-post.php or /wp-admin/admin-ajax.php (inferred).
  • Action Hook: Likely admin_post_kama_thumb_options or a similar hook registered via add_action( 'admin_init', ... ) (inferred).
  • HTTP Method: POST
  • Payload Parameter: Any plugin setting (e.g., kama_thumbnail_options[width], kama_thumbnail_options[height], or a toggle for automatic generation).
  • Authentication Level: CSRF requires an active administrator session; however, the request itself is "unauthenticated" from the attacker's perspective.
  • Preconditions: An administrator must be logged into the target WordPress site and must be tricked into visiting an attacker-controlled URL or submitting a forged form.

3. Code Flow

  1. Entry Point: The plugin registers a handler for administrative actions using add_action( 'admin_post_{action}', ... ) or directly processes $_POST data inside a function hooked to admin_init.
  2. Vulnerable Sink: The handler (e.g., kama_thumbnail_options_save - inferred) proceeds to call update_option( 'kama_thumbnail_options', ... ) using values from $_POST.
  3. Missing Check: Before updating the options, the code fails to call check_admin_referer() or wp_verify_nonce().
  4. State Change: The database state is modified based on the forged request parameters.

4. Nonce Acquisition Strategy

According to the vulnerability description, the nonce check is either missing or incorrectly validated.

  • If Missing: No nonce is required. The exploit can be triggered with a direct POST request containing only the action and the desired payload.
  • If Incorrectly Validated: The plugin might be using a generic nonce (e.g., action -1) or verifying a nonce that is exposed on a public page.
  • Strategy for the Agent:
    1. The agent should first attempt the exploit without a nonce.
    2. If the plugin requires a nonce, the agent should search the source code for wp_create_nonce.
    3. If found, check if it's localized via wp_localize_script.
    4. If localized, the agent must:
      • Identify the script handle and the variable name (e.g., kama_thumb_data?.nonce).
      • Use browser_navigate to a page where the plugin is active (e.g., a post with thumbnails).
      • Use browser_eval("window.kama_thumb_data?.nonce") to extract it.

5. Exploitation Strategy

The goal is to demonstrate that an attacker can modify the plugin's settings via a CSRF-style request.

Step 1: Identify the Vulnerable Action
Search the plugin directory for the settings saving logic:
grep -rn "update_option" /var/www/html/wp-content/plugins/kama-thumbnail/
Look for the function containing this call and trace back to its add_action registration.

Step 2: Craft the Payload
Assume the action is kama_thumb_options and the settings are stored in an array named kama_thumb. A malicious payload might change the default thumbnail width to an extreme value.

Step 3: Execute the Exploit (via http_request)

// Simulated CSRF via a POST request as the Admin
await http_request.post('http://localhost:8080/wp-admin/admin-post.php', {
  headers: {
    'Content-Type': 'application/x-www-form-urlencoded',
  },
  params: {
    'action': 'kama_thumb_options', // (Inferred action name)
    'kama_thumb[width]': '9999',
    'kama_thumb[height]': '9999',
    'save_options': '1'
  }
});

Note: The agent must use the admin's session/cookies for this to succeed in a test environment.

6. Test Data Setup

  1. Plugin Installation: Install and activate kama-thumbnail version 3.5.1.
  2. Baseline Check: Run wp option get kama_thumbnail_options to record the current (default) values.
  3. Administrator Session: Ensure the http_request tool is configured with the cookies of a logged-in administrator.

7. Expected Results

  • The server should return a 302 Redirect back to the settings page (typical behavior for admin-post.php).
  • The kama_thumbnail_options entry in the wp_options table should be updated with the attacker's values.

8. Verification Steps

After sending the HTTP request, verify the success of the exploit using WP-CLI:

wp option get kama_thumbnail_options

Check if the output reflects the values sent in the POST request (e.g., width: 9999).

9. Alternative Approaches

  • Settings Reset: If updating specific settings fails, try to trigger a "Reset Settings" action if one exists, which often uses a different (and sometimes unprotected) action hook.
  • Cache Clearing: If settings update is protected, test the "Clear Cache" functionality. While "Low Integrity," clearing the cache of a high-traffic site via CSRF can lead to a Denial of Service (DoS) by causing a massive CPU spike during regeneration. Look for actions like kama_thumb_clear_cache.
  • JS-based Extraction: If a nonce is present but poorly implemented, use browser_eval to see if the nonce is available on the frontend to unauthenticated users (e.g., uid=0 nonces).
Research Findings
Static analysis — not yet PoC-verified

Summary

The Kama Thumbnail plugin for WordPress is vulnerable to Cross-Site Request Forgery (CSRF) due to a lack of nonce validation in its administrative settings handler. This allows unauthenticated attackers to modify plugin configurations or clear the thumbnail cache by tricking a logged-in administrator into submitting a forged request.

Vulnerable Code

// kama-thumbnail/kama-thumbnail.php (Inferred location)

add_action( 'admin_init', 'kama_thumbnail_options_save' );

function kama_thumbnail_options_save() {
    // The function lacks a call to check_admin_referer() or wp_verify_nonce()
    if ( isset( $_POST['save_options'] ) ) {
        $options = $_POST['kama_thumbnail_options'];
        update_option( 'kama_thumbnail_options', $options );
        
        // Redirection logic often follows
        wp_redirect( admin_url( 'options-general.php?page=kama-thumbnail&settings-updated=true' ) );
        exit;
    }
}

---

// Alternative vulnerable sink for cache clearing
add_action( 'admin_post_kama_thumb_clear_cache', 'kama_thumb_clear_cache' );

function kama_thumb_clear_cache() {
    // Missing nonce verification allows CSRF to clear the cache directory
    $cache_dir = KAMA_THUMB_CACHE_DIR;
    kama_thumb_recursive_remove( $cache_dir );
    wp_redirect( wp_get_referer() );
    exit;
}

Security Fix

--- kama-thumbnail/kama-thumbnail.php
+++ kama-thumbnail/kama-thumbnail.php
@@ -5,6 +5,10 @@
 
 function kama_thumbnail_options_save() {
     if ( isset( $_POST['save_options'] ) ) {
+        if ( ! isset( $_POST['kama_thumb_nonce'] ) || ! wp_verify_nonce( $_POST['kama_thumb_nonce'], 'kama_thumb_save_action' ) ) {
+            wp_die( 'Security check failed' );
+        }
+
         $options = $_POST['kama_thumbnail_options'];
         update_option( 'kama_thumbnail_options', $options );
 
@@ -20,6 +24,10 @@
 
 function kama_thumb_clear_cache() {
+    if ( ! isset( $_GET['_wpnonce'] ) || ! wp_verify_nonce( $_GET['_wpnonce'], 'kama_thumb_clear_cache_action' ) ) {
+        wp_die( 'Security check failed' );
+    }
+
     $cache_dir = KAMA_THUMB_CACHE_DIR;
     kama_thumb_recursive_remove( $cache_dir );

Exploit Outline

The exploit targets administrative endpoints like /wp-admin/admin-post.php or the plugin's settings page via a Cross-Site Request Forgery attack. 1. **Methodology**: The attacker crafts a malicious HTML page containing a hidden form that targets the WordPress administrative backend. 2. **Payload**: The form includes the `action` parameter (e.g., `kama_thumb_options`) and desired configuration values such as `kama_thumbnail_options[width]=9999`. To trigger the save logic, the `save_options` parameter is included. 3. **Execution**: The attacker tricks a logged-in site administrator into visiting the malicious page. Upon visit, the form is automatically submitted (via JavaScript) to the WordPress site. 4. **Outcome**: Because the plugin does not verify a cryptographic nonce, the WordPress core processes the request as a legitimate action performed by the administrator, resulting in unauthorized changes to the plugin's database options or deletion of the thumbnail cache.

Check if your site is affected.

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