Automattic / woocommerce-subscriptions-core

Subscriptions core package for WooCommerce
Other
87 stars 33 forks source link

Security (fraud): consider delaying subscription create operation, until order completes #366

Open lkraav opened 1 year ago

lkraav commented 1 year ago

Problem Description

This relates to combating increasingly widespread card testing attacks against WooCommerce stores.

From this attack perspective WooCommerce core

When your store gets hit, it can create tens of thousands garbage Users, Orders, Subscriptions overnight. These attacks have no upper time limit, it's only limited by how quickly site admins / devs can react, and deploy countermeasures.

Now you also have a massive cleanup operation to deal with, of which some parts have no "as it was before" solution - such as garbage sequential user/order/subscription IDs are not really possible to rewind, or gap-fill retroactively.

Solution Description

It's unlikely WooCommerce core can be adjusted to be more defensive any time soon.

To lower attack impact, I'm proposing to explore issue subject.

If we don't create Subscriptions immediately, there's less garbage not only because of attacks, but also regular business.

Testing instructions

N/A

Product impact

Dev notes

Order should gain all necessary meta (if it doesn't have it already), and status change hooks could do the job later.

Any reasons why not?

Additional context

https://github.com/woocommerce/woocommerce/issues/24603 https://github.com/woocommerce/woocommerce-gateway-stripe/issues/918 (maybe more)