This repository has been archived by the owner on May 26, 2023. It is now read-only.
8olidity - claimManager will cause BountyCore::refundDeposit() to fail #170
Labels
Duplicate
A valid issue that is a duplicate of an issue with `Has Duplicates` label
High
A valid High severity issue
Reward
A payout will be made for this issue
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
8olidity
high
claimManager will cause BountyCore::refundDeposit() to fail
Summary
Problems arise due to overlapping functionality of the two roles
Vulnerability Detail
The function of BountyCore::refundDeposit() is to implement the refund function, and the refunded assets can be ETH, nft, erc20token. And this function can only be called by depositmanager, and there is also a limit on the calling time.
There is also a function claimNft() in the BountyCore contract. This function allows the claimmanager to transfer the nft in the contract away. You can see that this function is the same as refundDeposit(), and the vulnerability also appears in this position.
When the claimmanager calls claimNft() to transfer the nft, the DepositManager cannot call refundDeposit() again to redeem the nft. Time limits and caller restrictions are bypassed. The functions of the two roles have conflicting parts, and there is no resolution for this conflict.
poc
Impact
claimManager will cause BountyCore::refundDeposit() to fail
Code Snippet
https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/Bounty/Implementations/BountyCore.sol#L64-L93
https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/Bounty/Implementations/BountyCore.sol#L125-L136
Tool used
Manual Review
Recommendation
Consider this kind of conflict, such as when the bounty is turned off, it is forbidden to call refundDeposit()
Duplicate of #263
The text was updated successfully, but these errors were encountered: