Royal Addons for Elementor – Addons and Templates Kit for Elementor <= 1.7.1052 - Missing Authorization
Description
The Royal Addons for Elementor – Addons and Templates Kit for Elementor plugin for WordPress is vulnerable to unauthorized access due to a missing capability check on a function in all versions up to, and including, 1.7.1052. 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
<=1.7.1052What Changed in the Fix
Changes introduced in v1.7.1053
Source Code
WordPress.org SVN# Exploitation Research Plan - CVE-2026-28135 ## 1. Vulnerability Summary The **Royal Addons for Elementor** plugin (<= 1.7.1052) contains a missing authorization vulnerability in several AJAX handlers. Specifically, functions related to the **Mega Menu** and **Templates Kit** registration fail to …
Show full research plan
Exploitation Research Plan - CVE-2026-28135
1. Vulnerability Summary
The Royal Addons for Elementor plugin (<= 1.7.1052) contains a missing authorization vulnerability in several AJAX handlers. Specifically, functions related to the Mega Menu and Templates Kit registration fail to properly validate user capabilities. Although some handlers are registered only for authenticated users (wp_ajax_), others are registered for unauthenticated users (wp_ajax_nopriv_) or the plugin incorrectly exposes administrative nonces to the frontend, allowing unauthenticated attackers to trigger sensitive actions like creating new posts or modifying settings.
2. Attack Vector Analysis
- Endpoint:
/wp-admin/admin-ajax.php - Action:
wpr_create_mega_menu_template(Identified inadmin/mega-menu.php) - Parameters:
action:wpr_create_mega_menu_templatenonce: A valid nonce for thewpr-mega-menu-jsaction.item_id: A numeric ID representing a menu item (can be an arbitrary integer).
- Authentication: Unauthenticated (per CVE description and CVSS Vector
PR:N). - Preconditions: The plugin must be active, and a valid nonce must be extracted from the frontend.
3. Code Flow
- The attacker sends a POST request to
admin-ajax.phpwithaction=wpr_create_mega_menu_template. - The request is routed to the
wpr_create_mega_menu_template()function inadmin/mega-menu.php. - The function retrieves the nonce from
$_POST['nonce']and the item ID from$_POST['item_id']. - Vulnerability: In affected versions, the function either lacks the
current_user_can('manage_options')check entirely or is incorrectly exposed viawp_ajax_nopriv_. - If
wp_verify_noncepasses, the code proceeds to:- Check if a mega menu already exists for that item:
get_post_meta( $menu_item_id, 'wpr-mega-menu-item', true ). - If not, it calls
wp_insert_post()to create a new post of typewpr_mega_menuwithpost_statusset topublish. - It updates the post meta:
update_post_meta( $menu_item_id, 'wpr-mega-menu-item', $mega_menu_id ).
- Check if a mega menu already exists for that item:
- The function returns a JSON response containing an
edit_linkto the newly created post.
4. Nonce Acquisition Strategy
The nonce wpr-mega-menu-js is required. This plugin typically localizes its data into a global JavaScript object accessible on the frontend if any Royal Addons components are active.
- Identify Trigger: The Mega Menu functionality often enqueues its scripts on any page displaying a navigation menu.
- Setup Page: Use WP-CLI to ensure a standard menu exists.
- Extraction:
- Navigate to the homepage or any public page.
- The plugin localizes data into a variable, often named
WprConfigorWprAddonsData(based on common patterns in this plugin). - JS Variable:
window.WprConfigorwindow.WPRConfig. - Nonce Key:
nonceor specificallymega_menu_nonce. - Verification: Check
admin/mega-menu.phpline 59:wp_verify_nonce( $nonce, 'wpr-mega-menu-js' ).
5. Exploitation Strategy
- Extract Nonce: Perform an unauthenticated GET request to the site's homepage and search the HTML for the
WprConfigobject containing thewpr-mega-menu-jsnonce. - Trigger Creation: Send an unauthenticated POST request to create a mega menu post.
HTTP Request (PoC)
POST /wp-admin/admin-ajax.php HTTP/1.1
Host: TARGET_HOST
Content-Type: application/x-www-form-urlencoded
action=wpr_create_mega_menu_template&nonce=EXTRACTED_NONCE&item_id=1337
- Analyze Response: A successful attack will return a JSON object:
{ "success": true, "data": { "edit_link": "http://TARGET_HOST/wp-admin/post.php?post=NEW_POST_ID&action=elementor" } }
6. Test Data Setup
- Install Plugin: Ensure
royal-elementor-addons<= 1.7.1052 is installed. - Create a Menu Item: The exploit targets an
item_id. Create a dummy menu item to ensure the post meta update has a target (thoughwp_insert_postwill trigger regardless of whether theitem_idexists).wp menu create "Test Menu" wp menu item add-post Test Menu 1 # Add home page to menu, ID will be output
7. Expected Results
- The HTTP response should contain a status 200 and the
edit_linkJSON. - A new post of type
wpr_mega_menushould be created in the database. - The
post_metafor the specifieditem_idshould be updated with the keywpr-mega-menu-item.
8. Verification Steps
- Check for New Post:
Confirm a post namedwp post list --post_type=wpr_mega_menu --fields=ID,post_title,post_statuswpr-mega-menu-item-1337exists and ispublish. - Check Post Meta:
Confirm the keywp post meta list 1337 # Use the item_id from the attackwpr-mega-menu-itemexists and points to the new post ID.
9. Alternative Approaches
If wpr_create_mega_menu_template is properly protected in the target version, check other AJAX actions registered in admin/templates-kit.php which are likely to have the same missing authorization vulnerability:
wpr_reset_previous_import: Could allow an attacker to wipe previous template imports.wpr_fix_royal_compatibility: Might perform unauthorized site configuration changes.wpr_activate_required_plugins: Could be used to force-activate plugins.
To test these, look for nonces localized under WprConfig.templates_kit_nonce or similar keys.
Summary
The Royal Addons for Elementor plugin is vulnerable to unauthorized access because multiple AJAX handlers, such as those for creating mega menu templates and managing template kits, fail to perform sufficient capability checks. This allows unauthenticated attackers to perform administrative actions, such as creating new posts and modifying metadata, by utilizing administrative nonces leaked to the site's frontend.
Vulnerable Code
// admin/mega-menu.php line 52 add_action( 'wp_ajax_wpr_create_mega_menu_template', 'wpr_create_mega_menu_template' ); add_action( 'wp_ajax_wpr_save_mega_menu_settings', 'wpr_save_mega_menu_settings' ); --- // admin/mega-menu.php line 61 function wpr_create_mega_menu_template() { $nonce = $_POST['nonce']; if ( !wp_verify_nonce( $nonce, 'wpr-mega-menu-js' ) || !current_user_can( 'manage_options' ) ) { return; // Get out of here, the nonce is rotten! } // $menu_id = intval( $_REQUEST['menu'] ); // $menu_item_id = intval( $_REQUEST['item'] ); $menu_item_id = intval( $_POST['item_id'] ); $mega_menu_id = get_post_meta( $menu_item_id, 'wpr-mega-menu-item', true ); if ( ! $mega_menu_id ) { $mega_menu_id = wp_insert_post( array( 'post_title' => 'wpr-mega-menu-item-' . $menu_item_id, 'post_status' => 'publish', 'post_type' => 'wpr_mega_menu', ) ); update_post_meta( $menu_item_id, 'wpr-mega-menu-item', $mega_menu_id ); } --- // admin/templates-kit.php line 17 add_action( 'wp_ajax_wpr_activate_required_theme', 'wpr_activate_required_theme' ); add_action( 'wp_ajax_wpr_activate_required_plugins', 'wpr_activate_required_plugins' ); add_action( 'wp_ajax_wpr_fix_royal_compatibility', 'wpr_fix_royal_compatibility' ); add_action( 'wp_ajax_wpr_reset_previous_import', 'wpr_reset_previous_import' ); add_action( 'wp_ajax_wpr_import_templates_kit', 'wpr_import_templates_kit' ); add_action( 'wp_ajax_wpr_final_settings_setup', 'wpr_final_settings_setup' ); add_action( 'wp_ajax_wpr_search_query_results', 'wpr_search_query_results' );
Security Fix
@@ -61,15 +61,23 @@ // Create Menu Template function wpr_create_mega_menu_template() { - $nonce = $_POST['nonce']; + if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'] ) ), 'wpr-mega-menu-js' ) || ! current_user_can( 'manage_options' ) ) { + wp_send_json_error( [ 'message' => 'Invalid request.' ] ); + return; + } + + if ( ! isset( $_POST['item_id'] ) ) { + wp_send_json_error( [ 'message' => 'Missing item_id.' ] ); + return; + } - if ( !wp_verify_nonce( $nonce, 'wpr-mega-menu-js' ) || !current_user_can( 'manage_options' ) ) { - return; // Get out of here, the nonce is rotten! + $menu_item_id = absint( $_POST['item_id'] ); + $menu_item = get_post( $menu_item_id ); + if ( ! $menu_item || $menu_item->post_type !== 'nav_menu_item' ) { + wp_send_json_error( [ 'message' => 'Invalid menu item.' ] ); + return; } - // $menu_id = intval( $_REQUEST['menu'] ); - // $menu_item_id = intval( $_REQUEST['item'] ); - $menu_item_id = intval( $_POST['item_id'] ); $mega_menu_id = get_post_meta( $menu_item_id, 'wpr-mega-menu-item', true ); if ( ! $mega_menu_id ) {
Exploit Outline
The exploit methodology involves the following steps: 1. Obtain a valid administrative nonce by performing an unauthenticated GET request to the site's homepage and searching the HTML for the `WprConfig` or `WPRConfig` JavaScript object, which contains the `wpr-mega-menu-js` nonce. 2. Construct an unauthenticated POST request to the `/wp-admin/admin-ajax.php` endpoint. 3. Include the parameter `action=wpr_create_mega_menu_template`, the extracted `nonce`, and an arbitrary integer for the `item_id` parameter. 4. Upon execution, the server will bypass authorization checks (due to the missing/incorrect capability validation in affected versions) and create a new published post of type `wpr_mega_menu`, returning a JSON response containing an Elementor edit link for the new post.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.