#1004
Your platform's refund service allows customers to request partial or full refunds on orders via processRefund(orderId, refundAmount, orderTotal).
The function currently performs no validation — an attacker can request a refund larger than the original order total, causing the platform to overpay, or a negative or zero refund amount.
This type of business logic flaw can be exploited to extract funds beyond what was paid, making it a serious financial risk.
Refund manipulation is a well-known payment fraud technique. Without server-side validation of refund bounds, attackers can drain platform balances through repeated over-refund requests.
'Invalid refund amount' if refundAmount is less than or equal to zero.'Refund exceeds order total' if refundAmount is greater than orderTotal.{ refunded: refundAmount, remaining: orderTotal - refundAmount } for valid inputs.processRefund('ord-1', 200, 100)// returns { refunded: 200, remaining: -100 } — overpaid!
processRefund('ord-1', 200, 100)// throws Error('Refund exceeds order total')