Too much fee charged when Seaport is partially filled
The fee calculation in SeaportProxy used the full order price rather than the actual amount filled, so when an order was partially filled the user was charged a fee on the entire price. An attacker could exploit this to pay a disproportionately high fee for a small purchase.
Submitted by cccz
When a user fulfills an order using SeaportProxy, fees are charged in the \_handleFees function based on orders.price.
function _handleFees(
BasicOrder[] calldata orders,
uint256 feeBp,
address feeRecipient
) private {
address lastOrderCurrency;
uint256 fee;
uint256 ordersLength = orders.length;
for (uint256 i; i < ordersLength; ) {
address currency = orders[i].currency;
uint256 orderFee = (orders[i].price * feeBp) / 10000;
According to the Seaport documentation, Seaport allows partial fulfillment of orders, which results in too much fee being charged when an order is partially filled https://docs.opensea.io/v2.0/reference/seaport-overview#partial-fills
Consider feeBp == 2%
The order on Seaport has a fill status of 0/100 and each item is worth 1 eth. User A fulfills the order using LooksRareAggregator.execute and sends 102 ETH, where order.price == 100 ETH.
Since the other user fulfilled the order before User A, when User A fulfills the order, the order status is 99/100.
Eventually User A buys an item for 1 ETH but pays a fee of 2 ETH.
Proof of Concept
Recommended Mitigation Steps
Consider charging fees based on the user’s actual filled price.
0xhiroshi (LooksRare) confirmed and commented:
We are dropping fees completely.
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
Likely the fee was computed from the order's listed price instead of the actual amount filled.
Impact
Users could be charged a fee far larger than the value of the items they actually receive when an order is partially filled.
What the attacker needed
Seaport order is partially filled by another user; User fulfills the remaining portion via LooksRareAggregator
The fix
The project dropped fees completely, but the recommended fix was to charge fees based on the actual filled price.
How it was found
- User A submits an order through LooksRareAggregator.execute with a price of 100 ETH and a 2% fee.
- Before User A's transaction is processed, another user fulfills 99% of the same Seaport order.
- User A's transaction then fills only the remaining 1% (1 ETH worth), but the fee is still calculated on the full 100 ETH price, resulting in a 2 ETH fee.
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.
When you buy something through this system, a small fee is added based on the price. But if someone else already bought part of the order, you only get a fraction of the items, yet the fee is still calculated on the full original price. So you end up paying a fee for items you never received.
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.