WP Manifestindependent plugin directory
manifest / ecommerce / woocommerce-subscriptions-cancel-subscription-confirmation

WooCommerce Subscriptions - Delete Cancel Subscription Confirmation WP Registry grade B. Medium-severity findings · 1 findingWP RegistryMedium-severity findings · 1 findingOpen the reportB

Require your subscribers to confirm just-one-more-time before cancelling their subscription.

★ 37stars
v3.0latest · 6 years ago

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/woocommerce/woocommerce-subscriptions-cancel-subscription-confirmation/archive/refs/heads/master.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

IMPORTANT: This code is made available in the hope that it will be useful, but without any warranty. See the GNU General Public License included with the code for more details. Automattic or WooCommerce support services are also not available to assist with the use of this code.

WooCommerce Subscriptions - Cancel Subscription Confirmation

For use with WooCommerce Subscriptions.

Install and activate this plugin. It will provide a confirmation dialog asking if the customer is sure they want to cancel their subscription.

Requirements

This plugin was built while WC 3.2.6 and WCS 2.2.16 were current, and have not been tested on any other versions. Use at own risk.

Installation

To install:

  1. Download the latest version of the plugin here
  2. Go to Plugins > Add New > Upload administration screen on your WordPress site
  3. Select the ZIP file you just downloaded
  4. Click Install Now
  5. Click Activate

Reporting Issues

If you find a problem or would like to request this plugin be extended, please open a new Issue.


Releases

3 releases.

Tag
Published
v3.0 latest
Aug 15, 2020 6 years ago
Jan 30, 2019 7 years ago
1.0
May 15, 2018 8 years ago

These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.

B grade

Security

WooCommerce Subscriptions - Delete Cancel Subscription Confirmation 1.0 · audited by WP Registry

Medium-severity findings.

1 medium
Audited release
1.0
Findings
1
Worst severity
medium
Content hash
fa5d1350fb385936dab780ca…

Findings

  • medium Logged-in users can add notes to arbitrary orders without ownership or nonce checks

    missing_auth

    wcs_cancel_confirmation is hooked only to wp_ajax_wcs_cancel_confirmation (any authenticated user; no nopriv). The function never calls current_user_can, never compares the order's customer id to get_current_user_id(), never verifies the id is a subscription the requester can view, and never calls check_ajax_referer/wp_verify_nonce. It loads whatever wc_get_order(intval($_POST['subscription_id'])) returns — shop_order, shop_subscription, or refund — concatenates a 'Cancellation Reason:' header with sanitize_text_field($_POST['reason_to_cancel']), add_order_note()'s it (private note; is_customer_note defaults to 0), save()'s, and echoes the new comment id. The My Account JS is not a control: the action is registered even when wcs-cancel-confirmation is 'no', and an attacker POSTs admin-ajax.php directly. Blast radius is integrity of the merchant-facing order-note audit trail (IDOR plus CSRF of any logged-in session), not storefront XSS, payment-gateway tamper, or unauthenticated writes. If the id is not an order, wc_get_order() is false and add_order_note() fatals that request.

    wcs-cancel-subscription-confirmation.php:76-91

    Recommendation

    Before add_order_note: check_ajax_referer on a nonce localized only on My Account; load the object with wcs_get_subscription(); return if it is not a subscription; require that the current user owns it (get_user_id() === get_current_user_id()) or current_user_can('edit_shop_order', $id). Do not register the AJAX action when the reason prompt is disabled. Guard against a non-object wc_get_order() result.

WP Registry hashes the installable build and reports on that exact bytes-for-bytes copy. Embargoed findings are withheld until they are disclosed, so a clean verdict means nothing public is outstanding. WP Manifest does not audit code itself.