UPI QR Code Payment Gateway for WooCommerce <= 1.5.1 - Missing Authorization
Description
The UPI QR Code Payment Gateway for WooCommerce 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.5.1. 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.5.1Source Code
WordPress.org SVN# Exploitation Research Plan - CVE-2025-67969 ## 1. Vulnerability Summary The **UPI QR Code Payment Gateway for WooCommerce** plugin (<= 1.5.1) contains a missing authorization vulnerability. Specifically, an administrative or sensitive function is exposed via an AJAX handler or a hook (likely `adm…
Show full research plan
Exploitation Research Plan - CVE-2025-67969
1. Vulnerability Summary
The UPI QR Code Payment Gateway for WooCommerce plugin (<= 1.5.1) contains a missing authorization vulnerability. Specifically, an administrative or sensitive function is exposed via an AJAX handler or a hook (likely admin_init or wp_ajax_nopriv_*) without a corresponding capability check (like current_user_can( 'manage_options' )). This allows an unauthenticated attacker to perform actions such as modifying plugin settings, which could include changing the UPI ID (VPA) or merchant details, effectively hijacking payments.
2. Attack Vector Analysis
- Endpoint:
/wp-admin/admin-ajax.php - Action:
uqcp_save_settings(inferred based on plugin naming conventions) or a similar handler. - Parameters: Likely
action,uqcp_upi_id(orvpa),uqcp_merchant_name, and a nonce. - Authentication: Unauthenticated (leveraging
wp_ajax_nopriv_oradmin_init). - Preconditions: The plugin must be active and configured with WooCommerce.
3. Code Flow
- Entry Point: An unauthenticated request is sent to
admin-ajax.php. - Hook Registration: The plugin registers a handler in
includes/class-upi-qr-payment-gateway-woocommerce.php(inferred) oradmin/class-upi-qr-admin.php(inferred) using:add_action( 'wp_ajax_nopriv_uqcp_save_settings', array( $this, 'save_settings' ) );
OR a function is hooked toadmin_initwhich executes on every request toadmin-ajax.php. - Vulnerable Function: The callback function (e.g.,
save_settings) is called. - Missing Check: The function performs
update_option()or similar database operations without verifying the user's permissions viacurrent_user_can(). - Sink: The
update_option()function persists the attacker-supplied settings (e.g., a malicious UPI ID).
4. Nonce Acquisition Strategy
If the vulnerable endpoint requires a nonce for verification via check_ajax_referer() or wp_verify_nonce(), follow this strategy:
- Identify the Localization: Search the source code for
wp_localize_scriptto find the JS object and nonce key.- Search Command:
grep -r "wp_localize_script" . - Likely JS Variable:
window.uqcp_admin_varsorwindow.uqcp_vars(inferred). - Likely Nonce Key:
nonceoruqcp_nonce.
- Search Command:
- Locate the Triggering Page: Identify if the script is enqueued on the plugin's settings page or a public WooCommerce checkout/product page.
- Create a Triggering Page: If the nonce is only loaded for certain shortcodes:
wp post create --post_type=page --post_status=publish --post_content='[upi_qr_code]'(inferred shortcode).
- Extract via Browser:
- Navigate to the page.
- Use
browser_eval("window.uqcp_vars?.nonce")to retrieve the valid token.
5. Exploitation Strategy
We will attempt to change the Merchant UPI ID (VPA) to an attacker-controlled address.
- Request URL:
http://localhost:8080/wp-admin/admin-ajax.php - Method:
POST - Content-Type:
application/x-www-form-urlencoded - Payload (Draft):
action=uqcp_save_settings& uqcp_upi_id=attacker@upi& uqcp_merchant_name=Attacker+Merchant& security=[NONCE_OBTAINED_IN_STEP_4] - Step-by-Step:
- Confirm the exact action name and parameter names by grepping the source for
update_optioninside functions registered towp_ajax. - Obtain the nonce if required (as per Section 4).
- Send the
http_requestwith the payload to update the UPI ID. - Verify the change.
- Confirm the exact action name and parameter names by grepping the source for
6. Test Data Setup
- Install WooCommerce: Ensure WooCommerce is active.
- Enable Plugin: Activate "UPI QR Code Payment Gateway for WooCommerce".
- Initial Configuration: Set a dummy UPI ID in the plugin settings (e.g.,
original@upi). - Page Creation: Create a page containing the plugin's QR display shortcode to ensure scripts and nonces are loaded.
7. Expected Results
- The
admin-ajax.phpresponse should indicate success (e.g.,{"success":true}or1). - The
uqcp_upi_id(or equivalent) option in the WordPress database should be updated toattacker@upi.
8. Verification Steps
- WP-CLI Check:
wp option get uqcp_upi_id(or the actual option name found during research).
- Checkout Verification:
- Add a product to the cart and proceed to checkout.
- Select the UPI QR payment method.
- Inspect the generated QR code or data-attributes to confirm it now uses
attacker@upi.
9. Alternative Approaches
- Settings Save via
admin_init: If the vulnerability is in anadmin_inithook, the request might not need anactionparameter in the body but rather specific GET/POST parameters that trigger the save logic whenis_admin()is false (asadmin_initstill fires). - Direct Option Update: If the plugin uses a generic
save_optionsfunction, try to pass arbitrary option names to change other critical site settings (e.g.,users_can_register).
Summary
The UPI QR Code Payment Gateway for WooCommerce plugin is vulnerable to unauthorized settings modification due to a missing authorization check on its AJAX handlers. Unauthenticated attackers can exploit this to change the merchant's UPI ID (VPA), effectively hijacking payment flows by redirecting funds to an attacker-controlled address.
Exploit Outline
1. Identify the AJAX endpoint at /wp-admin/admin-ajax.php and the settings-save action (inferred as uqcp_save_settings). 2. Construct a POST request targeting the AJAX endpoint. 3. Include the action parameter along with the settings to be hijacked, specifically the UPI ID (e.g., uqcp_upi_id=attacker@upi) and the merchant name. 4. Send the request without any authentication headers or valid session cookies. 5. Verify the configuration change by initiating a test checkout and inspecting the generated QR code to ensure it points to the attacker's VPA.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.