Gaining unlimited bonus points on websites with WooCommerce Points and Rewards
The WooCommerce Points and Rewards plugin awarded bonus points as soon as an order reached the Processing status, which happens immediately for Cash On Delivery orders before any payment is made. An attacker could place repeated Cash On Delivery orders to accumulate unlimited bonus points and spend them on later orders.
Originally disclosed on HackerOne
- Fixed in 5 days
- Paid in 5 days
- Disclosed after 36 days
In WooCommerce Points and Rewards plugin there is an assumption that Processing order status is only for paid orders.
However, this assumption is wrong for payment gateway Cash On Delivery, which immediately changes order status to Processing on all new orders. Plugin then increases bonus points for the order total which are immediately available to spend.
The problematic code is in class-wc-points-rewards-order.php in function maybe_update_points which gets triggered by following actions:
woocommerce_order_status_processing
woocommerce_order_status_completed
woocommerce_order_status_on-hold
The code itself is on lines 50-58:
public function maybe_update_points( $order_id ) {
$order = wc_get_order( $order_id );
$this->maybe_deduct_redeemed_points( $order_id );
if ( 'on-hold' !== $order->get_status() ) {
$this->add_points_earned( $order_id );
}
}
The solution is to either increase points only on completed orders or to add an extra check if status is processing and payment method is not cash on delivery.
Example solution, change code to:
public function maybe_update_points( $order_id ) {
$order = wc_get_order( $order_id );
$this->maybe_deduct_redeemed_points( $order_id );
if ( $order->get_status() !== 'on-hold' && $order->get_status() !== 'processing' ) {
$this->add_points_earned( $order_id );
}
}
Impact
An attacker can gain an unlimited amount of bonus points and spend them on next orders. The only requirements are WooCommerce Points and Rewards enabled on the website and payment gateway Cash On Delivery enabled, both are very common. Cash on delivery is a core WooCommerce payment gateway. Points and Rewards is easily identified by bonus messages on product pages and on checkout. This bug works on the latest plugin version. The only limit on spending bonus points is defined in plugin settings (eg maximum 50% point redemption).
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The plugin assumed the Processing order status always meant the order was paid, and awarded points on that status without checking the payment method.
Impact
An attacker could gain unlimited bonus points and spend them on subsequent orders, limited only by the plugin's redemption settings such as a maximum percentage per order.
What the attacker needed
Points and Rewards plugin enabled; Cash On Delivery gateway enabled; No payment required upfront
The fix
The plugin should only award points on completed orders, or skip awarding when the status is processing and the payment method is cash on delivery.
How it was found
- Enable the Points and Rewards plugin and the Cash On Delivery payment gateway on the shop.
- Place an order using Cash On Delivery, which moves the order to Processing immediately.
- The plugin awards bonus points for the order total, which become available to spend.
- Repeat orders to accumulate unlimited points and redeem them on later orders.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A loyalty plugin gives you points when an order is paid. But with cash-on-delivery, the shop marks the order as 'processing' straight away, before any money changes hands. The plugin treated that as payment and handed out points, so someone could keep ordering without paying and collect points to spend later.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.