The buyOrder() function is designed to allow users to purchase active sell orders by paying the specified USDC price and receiving the tokens. Under normal operation, the function calculates protocol fees by multiplying the order price by the fee percentage.
The specific issue is that the fee calculation performs unchecked arithmetic multiplication that can overflow when dealing with very large prices, causing legitimate transactions to revert unexpectedly and potentially creating denial-of-service conditions for high-value orders.
This multiplication is done without overflow checks. If order.priceInUSDC is close to type(uint256).max, and FEE is nonzero, the result can exceed uint256.max, causing the transaction to revert unexpectedly.
Likelihood:
Large institutional orders or high-value token sales can trigger overflow conditions
Attackers can deliberately create orders with maximum uint256 values to cause reverts
The probability increases as token values and order sizes grow over time
Impact:
Transaction reverts prevent legitimate high-value orders from being executed
Denial-of-service condition where the contract becomes unusable for large orders
Loss of protocol functionality for institutional users or high-value trades
Potential economic impact if large orders cannot be processed during critical market conditions
Protocol Suffers Potential Revenue Leakage due to Precision Loss in Fee Calculation
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.