Priority: low — data-integrity hardening. Found during the 2026-06-11 operational-flow audit (F4).
OrdersController#create and #update build order items straight from cart_item_params[:item_id] and [:pickup_day_id] with no check that the item belongs to the order's menu or that the pickup day is one of that menu's pickup_days:
filtered_params = {
item_id: cart_item_params[:item_id],
quantity: cart_item_params[:quantity].presence || 1,
pickup_day_id: cart_item_params[:pickup_day_id] || @menu.pickup_days.first.id
}
order.order_items.create!(filtered_params)
A crafted cart can attach arbitrary Items (including other menus' items or PAY_IT_FORWARD) and arbitrary pickup days. Low security impact on a human-moderated site, but it corrupts order/credit accounting (credits derive from items.credits) and pickup-list generation.
Fix: validate that each item_id is in @menu.items and each pickup_day_id is in @menu.pickup_days before creating order items; reject otherwise.
Related: #170 (order integrity).
Priority: low — data-integrity hardening. Found during the 2026-06-11 operational-flow audit (F4).
OrdersController#createand#updatebuild order items straight fromcart_item_params[:item_id]and[:pickup_day_id]with no check that the item belongs to the order's menu or that the pickup day is one of that menu'spickup_days:A crafted cart can attach arbitrary
Items (including other menus' items orPAY_IT_FORWARD) and arbitrary pickup days. Low security impact on a human-moderated site, but it corrupts order/credit accounting (credits derive fromitems.credits) and pickup-list generation.Fix: validate that each
item_idis in@menu.itemsand eachpickup_day_idis in@menu.pickup_daysbefore creating order items; reject otherwise.Related: #170 (order integrity).