This repository has been archived by the owner on May 26, 2023. It is now read-only.
HonorLt - Closed bounty is considered claimable #386
Labels
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
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
HonorLt
medium
Closed bounty is considered claimable
Summary
When the bounty type is not found, it is considered claimable if the status is closed.
Vulnerability Detail
When deciding if the bounty is claimable if the type is not among the known definitions, it returns true if the status is 1:
1 means the bounty is closed, thus a bounty with an unknown type is considered claimable if it is closed. I believe this is a wrong assumption. Also, the name of the function is a bit misleading because it actually indicates if the bounty is open, while the reader might think it indicates if you can claim the rewards.
Impact
The claim manager will trick the outside readers and if a new bounty type is introduced in the future, this function will return an inverted result.
Code Snippet
https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/ClaimManager/Implementations/ClaimManagerV1.sol#L355-L364
Tool used
Manual Review
Recommendation
It should throw an error (revert with
UNKNOWN_BOUNTY TYPE
) in the else block.The text was updated successfully, but these errors were encountered: