Platform: Code4rena
Start Date: 07/04/2023
Pot Size: $47,000 USDC
Total HM: 20
Participants: 120
Period: 6 days
Judge: GalloDaSballo
Total Solo HM: 4
Id: 230
League: ETH
Rank: 77/120
Findings: 1
Award: $26.76
🌟 Selected for report: 0
🚀 Solo Findings: 0
26.761 USDC - $26.76
-- A malicious owner of privatePool can keep track of all the approve()
transaction that is required by traders in order to execute buy()
transaction.
-- Owner then frontruns these buy()
transactions using execute()
and directly transferring the approved NFT of the trader directly to him.
-- The trader buy()
transaction fails and also trader loses it's nft.
-- This similar impact can be observed for underlying base ERC-20 token during sell()
transaction.
-- All external approves to the private pools are under risk and mercy of the owner.
target
argument as _nft
contract itself, and data
argument to be transferFrom(victim,owner,tokenId)
.function execute(address target, bytes memory data) public payable onlyOwner returns (bytes memory) { // call the target with the value and data (bool success, bytes memory returnData) = target.call{value: msg.value}(data); // if the call succeeded return the return data if (success) return returnData; // if we got an error bubble up the error message if (returnData.length > 0) { // solhint-disable-next-line no-inline-assembly assembly { let returnData_size := mload(returnData) revert(add(32, returnData), returnData_size) } } else { revert(); } }
-- Manual Review -- Foundry
#0 - c4-pre-sort
2023-04-20T16:40:05Z
0xSorryNotSorry marked the issue as duplicate of #184
#1 - c4-judge
2023-05-01T19:21:28Z
GalloDaSballo marked the issue as satisfactory