Orders may not be fillable due to missing approvals
The contract does not check the return value of ERC20 approve, so an order can be listed even if the approval to the conduit failed. An attacker could create an unfillable order that locks user funds, as the only remedies are costly or may never occur.
Submitted by IllIllI, also found by gzeon
Not all IERC20 implementations revert() when there’s a failure in approve(). If one of these tokens returns false, there is no check for whether this has happened during the order listing validation, so it will only be detected when the order is attempted.
Impact
If the approval failure isn’t detected, the listing will never be fillable, because the funds won’t be able to be pulled from the opensea conduit. Once this happens, and if it’s detected, the only way to fix it is to create a counter-listing at a lower price (which may be below the market value of the tokens), waiting for the order to expire (which it may never), or by buying out all of the Rae to cancel the order (very expensive and defeats the purpose of pooling funds in the first place).
Proof of Concept
The return value of approve() isn’t checked, so the order will be allowed to be listed without having approved the conduit:
// File: src/seaport/targets/SeaportLister.sol : SeaportLister.validateListing() #1
29 for (uint256 i; i < ordersLength; ++i) {
30 uint256 offerLength = _orders[i].parameters.offer.length;
31 for (uint256 j; j < offerLength; ++j) {
32 OfferItem memory offer = _orders[i].parameters.offer[j];
33 address token = offer.token;
34 ItemType itemType = offer.itemType;
35 if (itemType == ItemType.ERC721)
36 IERC721(token).setApprovalForAll(conduit, true);
37 if (itemType == ItemType.ERC1155)
38 IERC1155(token).setApprovalForAll(conduit, true);
39 if (itemType == ItemType.ERC20)
40 @> IERC20(token).approve(conduit, type(uint256).max);
41 }
42 }
43 }
44 // Validates the order on-chain so no signature is required to fill it
45 assert(ConsiderationInterface(_consideration).validate(_orders));
46: }
Recommended Mitigation Steps
Use OpenZeppelin’s safeApprove(), which checks the return code and reverts if it’s not success.
mehtaculous (Tessera) disputed and commented:
Disagree with validity. The listing would just need to be canceled and a new order would be created (without the ERC20 token that is not able to be approved)
cancel()can only be performed by the proposer, or throughrejectActive():or by buying out all of the Rae to cancel the order (very expensive and defeats the purpose of pooling funds in the first place).
While unlikely, it is an attack vector to hold user funds hostage.
stevennevins (Tessera) acknowledged
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
The contract calls IERC20.approve without checking its return value, so a failed approval is not detected during listing validation.
Impact
If the approval failure isn’t detected, the listing will never be fillable, and the only fixes are to create a counter-listing at a lower price, wait for expiry (which may never happen), or buy out all Rae to cancel (very expensive).
What the attacker needed
A token whose approve returns false instead of reverting
The fix
Use OpenZeppelin’s safeApprove(), which checks the return code and reverts if it’s not success.
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.
Some tokens do not revert when an approval fails; they just return false. The contract ignores that false, so it thinks the approval worked and allows the order to be listed. Later, when someone tries to fill the order, the transfer fails because the approval was never actually granted.
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.