External Control of Assumed-Immutable Web Parameter (CWE-472) in the cart and checkout flow of MarcosCamara01 Ecommerce Template allows an authenticated user with no special privileges to be charged the price of one product while placing an order for another, because POST /api/user/cart accepts variantId, which determines what the order records, and stripeId, which determines what Stripe charges, as two independent fields of the request body, stores both on the cart row, and no check requires the stripeId to be the one that belongs to the variantId. POST /api/stripe/payment строит линейные элементы Stripe Checkout из сохраненного значения, как цена: item.stripeId, количество , поэтому взимаемая сумма является суммой этой цены Stripe. Вебхук checkout.session.completed затем создает продукты заказа из variantId той же строки корзины, поэтому заказ записывает продукт, который не был оплачен. Каждый stripeId в каталоге читается любым посетителем, поэтому значение не должно быть угадано.
Это приводит к тому, что заказы на товары по цене самого дешевого товара в каталоге повторяются без ограничений и в записях заказа, количество которых не соответствует перечисленному продукту.
Показать оригинальное описание (EN)
External Control of Assumed-Immutable Web Parameter (CWE-472) in the cart and checkout flow of MarcosCamara01 Ecommerce Template allows an authenticated user with no special privileges to be charged the price of one product while placing an order for another, because POST /api/user/cart accepts variantId, which determines what the order records, and stripeId, which determines what Stripe charges, as two independent fields of the request body, stores both on the cart row, and no check requires the stripeId to be the one that belongs to the variantId. POST /api/stripe/payment builds the Stripe Checkout line items from the stored value, as { price: item.stripeId, quantity }, so the amount charged is the amount of that Stripe price. The checkout.session.completed webhook then creates the order products from the variantId of the same cart row, so the order records a product that was not paid for. Every stripeId in the catalogue is readable by any visitor, so no value has to be guessed. This results in orders for goods at the price of the cheapest item in the catalogue, repeatable without limit, and in order records whose amount does not correspond to the product they list.
Характеристики атаки
Последствия
Строка CVSS v4.0