Royal MCP – Secure AI Connector for Claude, ChatGPT & Gemini <= 1.4.2 - Missing Authorization
Description
The Royal MCP – Secure AI Connector for Claude, ChatGPT & Gemini plugin for WordPress is vulnerable to unauthorized access due to a missing capability check on a function in versions up to, and including, 1.4.2. 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
Source Code
WordPress.org SVNPatched version not available.
This research plan targets CVE-2026-40775, a missing authorization vulnerability in the Royal MCP plugin (<= 1.4.2). The vulnerability allows unauthenticated attackers to perform actions that should be restricted to administrators. ### 1. Vulnerability Summary The **Royal MCP** plugin fails to impl…
Show full research plan
This research plan targets CVE-2026-40775, a missing authorization vulnerability in the Royal MCP plugin (<= 1.4.2). The vulnerability allows unauthenticated attackers to perform actions that should be restricted to administrators.
1. Vulnerability Summary
The Royal MCP plugin fails to implement proper capability checks (authorization) on one or more of its AJAX or REST API endpoints. While it may use nonces for CSRF protection, the absence of current_user_can() in the handler functions, combined with the registration of these functions via wp_ajax_nopriv_* hooks, allows unauthenticated users to trigger the logic. Based on the CVSS vector (Integrity: Low), the vulnerability likely permits the modification of plugin settings or configuration.
2. Attack Vector Analysis
- Endpoint:
wp-admin/admin-ajax.php - Action (Likely):
rmcp_save_settingsorroyal_mcp_save_config(to be verified in source). - Authentication: None required (unauthenticated).
- Preconditions: The plugin must be active. A nonce may be required, but can be obtained from the frontend if the plugin localizes scripts for unauthenticated users (e.g., for a chat widget).
3. Code Flow
- Registration: The plugin registers an AJAX handler in its main class or an initialization file:
add_action('wp_ajax_nopriv_[ACTION_NAME]', 'handle_action_function'); - Entry Point: An unauthenticated user sends a POST request to
admin-ajax.phpwithaction=[ACTION_NAME]. - The Sink: The
handle_action_functionis executed.- It may check a nonce using
check_ajax_refererorwp_verify_nonce. - The Flaw: It skips
if (!current_user_can('manage_options')) { wp_die(); }. - It proceeds to update database options using
update_option()based on$_POSTparameters.
- It may check a nonce using
4. Nonce Acquisition Strategy
If the vulnerable function requires a nonce, we will extract it from the frontend.
- Identify Entry Point: Search for
wp_localize_scriptin the plugin code to find where nonces are exposed to the browser. - Shortcode Discovery: Search for
add_shortcodeto find the tag that renders the plugin's interface (e.g.,[royal_mcp_chat]). - Page Setup: Create a public page containing this shortcode.
wp post create --post_type=page --post_status=publish --post_title="AI Chat" --post_content='[shortcode_found]' - Extraction:
- Navigate to the newly created page using
browser_navigate. - Identify the global JS object. Based on common plugin patterns, look for
royal_mcp_data,rmcp_vars, orrmcp_params. - Execute:
browser_eval("window.rmcp_vars?.nonce")(Replace with the actual variable and key found in source).
- Navigate to the newly created page using
5. Exploitation Strategy
Step 1: Discovery
- Search for
wp_ajax_nopriv_in the plugin directory:grep -r "wp_ajax_nopriv_" . - Locate the handler function and check if it modifies options (e.g., calls
update_option). - Identify the parameter names for the settings.
Step 2: Craft Payload
- Target URL:
http://[target]/wp-admin/admin-ajax.php - Method: POST
- Content-Type:
application/x-www-form-urlencoded - Parameters:
action:[action_found]_ajax_nonce:[extracted_nonce]setting_key:malicious_value(e.g., changing the AI model to an expensive one or disabling security filters).
Step 3: Execute Request
Use the http_request tool to send the payload.
6. Test Data Setup
- Install and activate Royal MCP <= 1.4.2.
- Note the current value of a target setting (e.g., the API key or default model).
wp option get royal_mcp_settings - If a nonce is needed, identify the shortcode (e.g.,
[royal_mcp_connector]) and create a page to expose it as described in Section 4.
7. Expected Results
- The server should return a successful status code (e.g.,
200 OKor a JSON success message{"success":true}). - The targeted WordPress option (setting) should be updated in the database despite the request being unauthenticated.
8. Verification Steps
After the HTTP request, verify the change via WP-CLI:
# Check if the option was modified
wp option get [OPTION_NAME_FOUND]
If the option value matches the malicious_value sent in the POST request, the exploit is successful.
9. Alternative Approaches
- REST API: If no AJAX actions are found, check
register_rest_route. Look for routes where'permission_callback'is set to__return_trueor is missing entirely, especially those handlingPOSTorPUTrequests. - Settings Reset: Look for actions that reset settings to defaults. While "Integrity: Low", resetting an API configuration can still disrupt service.
- Missing Nonce: Check if
check_ajax_refereris actually called. If it is omitted or called withdie=falsewithout checking the return value, the nonce acquisition step can be skipped.
Summary
The Royal MCP plugin for WordPress is vulnerable to unauthorized data modification in versions up to 1.4.2 due to missing capability checks on AJAX handlers. This allows unauthenticated attackers to execute administrative functions, such as changing plugin settings, by targeting endpoints registered with the wp_ajax_nopriv hook.
Exploit Outline
1. Identify the AJAX action registered via wp_ajax_nopriv in the plugin (likely associated with configuration or settings updates). 2. Extract the necessary security nonce from the frontend by viewing a page where the plugin's scripts are localized (e.g., a page utilizing the plugin's AI chat shortcode). 3. Send a POST request to /wp-admin/admin-ajax.php with the action parameter, the extracted nonce, and the desired malicious setting values. 4. Confirm the update by verifying the plugin's configuration via the WordPress dashboard or database.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.