This repository has been archived by the owner on May 26, 2023. It is now read-only.
joestakey - claimer not supporting ERC-721 tokens can be DOS #536
Labels
Low/Info
A valid Low/Informational severity issue
Non-Reward
This issue will not receive a payout
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
joestakey
medium
claimer not supporting ERC-721 tokens can be DOS
Summary
Anyone can prevent a claimer not supporting ERC-721 from claiming.
Vulnerability Detail
_claimAtomicBounty
loops through the ERC20 token deposits, then through the NFT deposits to send the rewardThis transfers the NFT to the claimer using a
safeTransferFrom
call.The issue is that the
safeTransferFrom
call reverts if the_payoutAddress
does not support ERC721 tokens.It means a claimer call can be DOS by front-running them with a
fundBountyNFT()
call, adding a NFT reward to the bounty, which will make the claimer unable to claim.Impact
Valid claimer is unable to claim their ERC20 token rewards.
It is likely that bounty issuers will specify the token the reward will be in.
Claimer could be using a smart wallet that does not support ERC-721 token, and seeing a bounty paying in
MATIC
(or any ERC20 token), would participate in the bounty. In such case, the attack would prevent them from claiming.Code Snippet
https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/ClaimManager/Implementations/ClaimManagerV1.sol#L150-L151
https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/Bounty/Implementations/BountyCore.sol#L262-L263
Tool used
Manual Review
Recommendation
Consider using a
try/catch
approach for claiming.The text was updated successfully, but these errors were encountered: