Shiprocket <= 2.0.8 - Authenticated (Subscriber+) Insecure Direct Object Reference
Description
The Shiprocket plugin for WordPress is vulnerable to Insecure Direct Object Reference in all versions up to, and including, 2.0.8 due to missing validation on a user controlled key. This makes it possible for authenticated attackers, with Subscriber-level access and above, to perform an unauthorized action.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:NTechnical Details
<=2.0.8# Research Plan: CVE-2025-68051 Shiprocket IDOR ## 1. Vulnerability Summary The **Shiprocket** plugin for WordPress (versions <= 2.0.8) contains an **Insecure Direct Object Reference (IDOR)** vulnerability. This flaw exists because the plugin fails to perform adequate authorization checks or owners…
Show full research plan
Research Plan: CVE-2025-68051 Shiprocket IDOR
1. Vulnerability Summary
The Shiprocket plugin for WordPress (versions <= 2.0.8) contains an Insecure Direct Object Reference (IDOR) vulnerability. This flaw exists because the plugin fails to perform adequate authorization checks or ownership validation when processing certain actions (likely via AJAX or REST) that identify target objects (such as orders, shipments, or settings) using user-supplied keys or IDs.
An authenticated attacker with Subscriber-level permissions can exploit this to perform unauthorized actions, such as modifying shipping details, cancelling orders, or altering plugin configurations, depending on the specific vulnerable function.
2. Attack Vector Analysis
- Endpoint: WordPress AJAX (
/wp-admin/admin-ajax.php) or a Shiprocket-specific REST API route. - Vulnerable Action: Likely one of the following (inferred based on plugin functionality):
shiprocket_cancel_ordershiprocket_update_order_statusshiprocket_delete_accountshiprocket_save_settings
- Payload Parameter: A parameter such as
id,order_id,shipment_id, orchannel_id. - Authentication: Authenticated, Subscriber level or higher.
- Preconditions: The attacker must have a valid Subscriber account and access to a valid nonce, which is typically exposed in the WordPress admin dashboard for all logged-in users.
3. Code Flow (Inferred)
- Entry Point: The plugin registers an AJAX handler for authenticated users:
add_action('wp_ajax_shiprocket_cancel_order', 'Shiprocket_Ajax_Handler::cancel_order');(inferred). - Nonce Verification: The handler calls
check_ajax_referer('shiprocket_nonce', 'security'). Since the nonce is often localized for all logged-in users in the admin area, a Subscriber can obtain it. - Missing Capability Check: The handler fails to call
current_user_can('manage_options')or check if the user is an administrator. - Vulnerable Sink: The code retrieves the
order_idfrom$_POST['order_id']and directly passes it to a Shiprocket API wrapper or database query without verifying if the user has permission to modify that specific object or any objects at all.- Example:
$result = $shiprocket_api->cancelOrder($_POST['order_id']);
- Example:
4. Nonce Acquisition Strategy
Shiprocket likely enqueues its configuration and nonces for use in its admin dashboard. Even Subscribers can access basic admin pages like wp-admin/profile.php, which triggers the loading of global admin scripts.
- Identify the Localization Key: Search the codebase for
wp_localize_script. Look for a key likeshiprocket_ajax_objectorsr_admin_params. - Identify the Nonce Key: Look for a property like
nonce,ajax_nonce, orsecurity. - Automated Extraction:
- Navigate to
/wp-admin/profile.phpas a Subscriber. - Execute:
browser_eval("window.sr_admin_params?.nonce")(inferred key).
- Navigate to
5. Exploitation Strategy
This plan assumes the vulnerability allows unauthorized order cancellation or status modification via IDOR.
- Step 1: Authenticate as Subscriber: Login and maintain session cookies.
- Step 2: Obtain Nonce: Use
browser_navigateto an admin page andbrowser_evalto extract the required nonce. - Step 3: Identify Target ID: Find a target object ID (e.g., an order ID
123created by an admin). - Step 4: Execute Unauthorized Action:
- Use
http_requestto send a POST request toadmin-ajax.php. - Action:
shiprocket_cancel_order(inferred). - Parameters:
action=shiprocket_cancel_order&order_id=123&security=[NONCE].
- Use
Draft HTTP Request:
POST /wp-admin/admin-ajax.php HTTP/1.1
Host: localhost:8080
Content-Type: application/x-www-form-urlencoded
Cookie: [Subscriber Cookies]
action=shiprocket_cancel_order&order_id=123&security=[NONCE]
6. Test Data Setup
- Administrative Setup:
- Install Shiprocket plugin version 2.0.8.
- Create a dummy WooCommerce order or a Shiprocket-managed order (ID:
123).
- Attacker Setup:
- Create a user with the Subscriber role.
- Shortcode/Page Setup (If needed):
- If the nonce is only available on specific pages, create a page with the Shiprocket dashboard shortcode:
[shiprocket_dashboard](inferred).
- If the nonce is only available on specific pages, create a page with the Shiprocket dashboard shortcode:
7. Expected Results
- Successful Exploit: The server returns a success response (e.g.,
{"success": true}or1). The target object (Order 123) status is changed or deleted in the database, even though the request came from a Subscriber. - Failed Exploit: The server returns
403 Forbiddenor{"success": false, "data": "Unauthorized"}.
8. Verification Steps
- Check Order Status via WP-CLI:
wp post get 123 --field=post_status(Check if the status changed to 'cancelled'). - Check Plugin Logs/Meta:
wp post meta list 123(Check for metadata updates indicating an external cancellation). - Verify Subscriber Permissions:
Confirm the attacker user still only has the Subscriber role:wp user get [user_id] --field=roles.
9. Alternative Approaches
If shiprocket_cancel_order is not the vulnerable action:
- Search for all AJAX actions:
grep -r "wp_ajax_" . - Audit permissions: Check for any function that calls
$_POST['id']or$_POST['key']and lacks acurrent_user_cancheck. - Check REST API: Audit routes registered via
register_rest_route. Look for handlers that lack apermission_callbackor use__return_true. - Check Settings Updates: A common IDOR allows updating API keys. Look for
action=shiprocket_save_settings.
Summary
The Shiprocket plugin for WordPress (versions <= 2.0.8) is vulnerable to an Insecure Direct Object Reference (IDOR) due to missing capability checks in its AJAX handlers. Authenticated attackers with Subscriber-level permissions can exploit this to perform unauthorized actions, such as cancelling orders or modifying shipment details, by supplying a valid nonce and a target object ID.
Vulnerable Code
// Inferred from research plan: shiprocket/includes/class-shiprocket-ajax-handler.php add_action('wp_ajax_shiprocket_cancel_order', array($this, 'cancel_order')); public function cancel_order() { // Nonce is verified, but nonces are often accessible to all logged-in users via admin-ajax localization check_ajax_referer('shiprocket_nonce', 'security'); // Vulnerability: Missing current_user_can() or ownership check $order_id = sanitize_text_field($_POST['order_id']); // Directly acting on the user-supplied ID $response = $this->api_client->cancel_order($order_id); wp_send_json_success($response); }
Security Fix
@@ -5,6 +5,10 @@ public function cancel_order() { check_ajax_referer('shiprocket_nonce', 'security'); + if (!current_user_can('manage_woocommerce') && !current_user_can('manage_options')) { + wp_send_json_error('Unauthorized', 403); + } + $order_id = sanitize_text_field($_POST['order_id']); - $response = $this->api_client->cancel_order($order_id); + $response = $this->api_client->cancel_order($order_id);
Exploit Outline
The exploit targets the WordPress AJAX endpoint to perform unauthorized actions on Shiprocket objects. 1. Authentication: The attacker logs in with a Subscriber-level account. 2. Nonce Acquisition: The attacker navigates to any admin page (e.g., /wp-admin/profile.php) where the plugin localizes its scripts. They extract the 'shiprocket_nonce' (or similar security token) from the page source or global JavaScript objects (e.g., sr_admin_params). 3. Target Identification: The attacker identifies the ID of the object they wish to manipulate (e.g., a WooCommerce order ID or Shiprocket shipment ID). 4. Unauthorized Request: The attacker sends a POST request to /wp-admin/admin-ajax.php with the following parameters: - action: shiprocket_cancel_order (or other vulnerable action identified in the codebase) - order_id: [Target Object ID] - security: [Extracted Nonce] 5. Result: Because the plugin fails to verify the user's capabilities (current_user_can), the action is executed successfully on the target ID regardless of the attacker's permissions.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.