Nexi XPay <= 8.3.0 - Missing Authorization to Unauthenticated Order Status Modification
Description
The Nexi XPay plugin for WordPress is vulnerable to unauthorized modification of data due to missing authorization checks on the redirect function in all versions up to, and including, 8.3.0. This makes it possible for unauthenticated attackers to mark pending WooCommerce orders as paid/completed.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:NTechnical Details
<=8.3.0What Changed in the Fix
Changes introduced in v8.3.2
Source Code
WordPress.org SVNThis exploitation research plan targets **CVE-2025-15565**, a missing authorization vulnerability in the **Nexi XPay** plugin for WordPress. ## 1. Vulnerability Summary The Nexi XPay plugin (specifically the gateway handler for WooCommerce) fails to perform adequate authorization or integrity check…
Show full research plan
This exploitation research plan targets CVE-2025-15565, a missing authorization vulnerability in the Nexi XPay plugin for WordPress.
1. Vulnerability Summary
The Nexi XPay plugin (specifically the gateway handler for WooCommerce) fails to perform adequate authorization or integrity checks on the function responsible for processing "return" redirects from the Nexi payment gateway.
In a standard workflow, a user is redirected to Nexi to pay and then redirected back to the merchant site with parameters indicating the outcome. The plugin should verify a Message Authentication Code (MAC) signature provided by Nexi to ensure the request is legitimate. Version 8.3.0 and below fail to enforce this check correctly or at all in specific redirect paths, allowing an unauthenticated attacker to spoof a successful payment response by crafting a GET or POST request to the callback handler.
2. Attack Vector Analysis
- Endpoint: The standard WooCommerce API callback endpoint.
- Action (Inferred):
wc_gateway_nexi_xpay_simple_paymentorcartasi_xpay(registered via thewoocommerce_api_{callback}hook). - URL Pattern:
https://target.tld/?wc-api=wc_gateway_nexi_xpay_simple_payment(or similar). - Vulnerable Parameters:
codTrans(the Order ID/Transaction Code),esito(the outcome, e.g.,OK), andmac(the signature, which is bypassed or missing). - Preconditions:
- The Nexi XPay plugin must be active and configured as a payment method in WooCommerce.
- An order must exist in a "Pending Payment" state.
- The attacker needs to know or guess the
codTrans(often matches the WooCommerce Order ID or a prefixed version).
3. Code Flow
- Entry Point: The request hits
index.php, WordPress loads, and WooCommerce identifies thewc-apiquery parameter. - Dispatch: WooCommerce triggers the hook
woocommerce_api_wc_gateway_nexi_xpay_simple_payment. - Vulnerable Function: The callback function (likely
check_responseorhandle_redirectinside the gateway class) is executed. - Input Processing: The code extracts
$_GET['codTrans']and$_GET['esito']. - Authorization Failure: The code checks if
esito == 'OK'but fails to validate themacparameter against the shared secret (Alias/MAC Key). - Sink: The code calls
$order->payment_complete()or$order->update_status('processing'), marking the order as paid.
4. Nonce Acquisition Strategy
This vulnerability resides in a Webhook/API callback intended for server-to-server or cross-site communication.
- Nonce Requirement: None. WooCommerce
wc-apihandlers do not use WordPress nonces because they must be accessible to external payment gateways (Nexi). - Authorization: The "Authorization" should be the
macparameter, which the description confirms is missing or not checked.
5. Exploitation Strategy
The goal is to move a "Pending" order to "Processing/Completed" without actual payment.
Step 1: Identify Order ID
An attacker would first place a legitimate order as a guest/customer to identify the codTrans format. Usually, it is just the Order ID.
Step 2: Craft Spoofed Redirect
Construct an HTTP request to the callback URL.
- URL:
http://localhost:8080/?wc-api=wc_gateway_nexi_xpay_simple_payment - Method: GET
- Parameters:
esito:OK(Signal success)codTrans:[ORDER_ID](The target order)mac:anyvalue(Or omitted, since the check is missing)
Step 3: Execution via http_request
// PoC logic to be run by the agent
await http_request({
url: "http://localhost:8080/?wc-api=wc_gateway_nexi_xpay_simple_payment&esito=OK&codTrans=123",
method: "GET"
});
6. Test Data Setup
- Install & Activate: Nexi XPay (cartasi-x-pay) <= 8.3.0 and WooCommerce.
- Gateway Config:
- Enable "Nexi XPay" in WooCommerce > Settings > Payments.
- Enter dummy values for "Alias" and "MAC Key" (necessary to initialize the gateway).
- Create Order:
- As a guest user, add a product to the cart.
- Proceed to checkout.
- Select "Nexi XPay" as the payment method.
- Click "Place Order". This will create an order in "Pending Payment" status.
- Capture Order ID: Use
wp-clito find the latest order ID:wp wc order list --status=pending --format=ids.
7. Expected Results
- Before Attack: Order status is
pending. - During Attack: The HTTP request to the callback URL returns a
200 OKor a redirect to the "Thank You" page. - After Attack: The Order status is changed to
processingorcompleted.
8. Verification Steps
After sending the request, verify the status via WP-CLI:
wp wc order get [ORDER_ID] --fields=status --format=json
Success is confirmed if the status is processing or completed.
9. Alternative Approaches
If the wc-api slug differs, check the source code for the hook registration:
- Search for
add_action( 'woocommerce_api_in the plugin directory. - The string following
woocommerce_api_is the value needed for thewc-apiquery parameter. - Common alternatives:
wc_gateway_nexi,nexi_xpay_return,cartasi_xpay_callback.
If the plugin uses a POST request for the notification (IPN style), change the http_request method to POST and pass parameters in the body. The vulnerability description mentions "redirect function," strongly suggesting GET via the user's browser redirect.
Summary
The Nexi XPay plugin for WordPress is vulnerable to unauthorized order status modification due to a lack of signature verification in its payment redirect handler. Unauthenticated attackers can exploit this by spoofing payment confirmation requests to the WooCommerce API callback endpoint, allowing them to mark pending orders as paid without actual financial transactions.
Security Fix
@@ -192,4 +192,4 @@ loadGooglePayButton(); } }, 500); -}); \ No newline at end of file +}); @@ -1 +1 @@ -<?php return array('dependencies' => array('jquery', 'lodash', 'react', 'wc-blocks-registry', 'wp-i18n', 'wp-polyfill'), 'version' => '369508ac78003c291513'); +<?php return array('dependencies' => array('jquery', 'react', 'wc-blocks-registry', 'wp-i18n', 'wp-polyfill'), 'version' => '03dff507f0562b6d2110');
Exploit Outline
The exploit involves spoofing a server-to-server or browser-redirect notification from the Nexi payment gateway to the merchant's site. 1. Identify a target Order ID in WooCommerce that is currently in 'Pending Payment' status. 2. Target the WooCommerce API callback endpoint registered by the plugin, typically: `/?wc-api=wc_gateway_nexi_xpay_simple_payment` (or similar, depending on the specific gateway module configuration). 3. Construct a GET or POST request to this endpoint containing the target order identifier (`codTrans`) and a successful outcome code (`esito=OK`). 4. Omit or provide any arbitrary value for the `mac` parameter. Because the vulnerable versions fail to validate the Message Authentication Code (MAC) signature against the shared secret, the plugin accepts the spoofed response as legitimate. 5. The order status is automatically updated to 'Processing' or 'Completed' in the WooCommerce backend, fulfilling the order without payment. 6. No authentication or valid WordPress nonces are required to hit this endpoint.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.