Closed c4-submissions closed 1 year ago
0xfoobar marked the issue as disagree with severity
0xfoobar (sponsor) disputed
This is not a vulnerability, DelegateTokens reflect future utility rights not past ones
GalloDaSballo changed the severity to QA (Quality Assurance)
As discussed by the Sponsor, the buyer is buying the future ability to claim
There is no guarantee of past claims
Such guarantee would have to be offered by a Sale Smart Contract which could have a Observer to determine what the buyer and seller are exchanging
The DT is agnostic to that as simply guarantees future claims
QA - L for gotcha
GalloDaSballo marked the issue as grade-c
Lines of code
https://github.com/code-423n4/2023-09-delegate/blob/main/src/CreateOfferer.sol#L52
Vulnerability details
Impact
Users are incentivized to traded their "airdrop rights". In order to do so, protocol can be used to place a Seaport order. Until the order is matched and filled, the user still could have rights to their NFT. That means, the listed token's price may include potential airdrop to be claimed. But malicious user could monitor mempool to see the match order transaction, and frontrun it, so the new buyer will receive the delegateToken as they should, but without the initial airdrop. A similar issue was present in another contest - here.
Proof of Concept
Essentially, there is no guarantee that upon completing the order, the user will not use their NFT to claim anything like an airdrop, effectively diminishing the potential value right after the buy transaction. If we check the unit test that was already shipped with the protocol with some small added debug prints that show the owner along the way:
The result is:
So there is a time windows where order is placed, and may contain the potential airdrops or other profits for the owner to be claimed, but in the last moment user will claim them, so the buyer will receive less value than expected.
Tools Used
Manual approach
Recommended Mitigation Steps
If order is placed via Delegate protocol, then the NFT could already be put into an escrow at the moment of placing the order, and the user could receive a simple receipt of a deposited token, to be claimed at any time and the order is invalidated then. This way, its potential value is guaranteed to be unchanged, because the NFT is already owned by the protocol.
Of course, there is another way, where just risk is accepted, in order to avoid developing another code. Then the users should be warned that ANY profit coming from holding a bought delegate tokens will be counted AFTER the successful transaction, and any claims that the bought NFT already holds any claimable value should not be trusted.
Assessed type
Other