Changing bribeVault in RewardDistributor.sol will Lock Current ETH Rewards
The RewardDistributor contract uses the bribeVault address to represent native ETH when claiming rewards. If the bribeVault address is changed via setBribeVault(), users with ETH rewards will be unable to claim them because the contract will attempt to call transfer() on the new bribeVault address, which is not an ERC20 token.
Originally disclosed on Code4rena
Submitted by kirk-baird, also found by WatchPug
RewardDistributor.sol#L178-#L182 RewardDistributor.sol#L65-#L73
Claiming of the ETH native currency requires token to be set to bribeVault. If the bribeVault is modified in setBribeVault() then users who have ETH rewards will now be considered to have ERC20(bribeVault) tokens. Since bribeVault is not an ERC20 token the transfer() call will fail and the users will not be able to claim their funds.
Recommended Mitigation Steps
Consider removing the functionality to change the bribeVault or ensuring all funds have been withdraw i.e. balanceOf(address(this)) == 0 before changing the bribeVault.
kphed (Redacted Cartel) confirmed and commented:
Good find, we’re going to address this by making
bribeVaultimmutable and removing the setter.Thanks again for participating in our contest kirk-baird, looking forward to more feedback/suggestions/comments.
Alex the Entreprenerd (judge) commented:
Agree with the finding, ultimately preventing
bribeVaultfrom changing will provide users further security guarantees.An alternative solution would be to use a different code for ETH (I’ve seen protocols use address(0) or perhaps 0xeeeeeeee).
However I believe that making
bribeVaultimmutable will provide the stronger guarantees.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The contract uses the bribeVault address as a sentinel for native ETH, but allows that address to be changed, breaking the assumption that it is not an ERC20 token.
Impact
Users with ETH rewards could be unable to claim their funds after the bribeVault address is changed.
What the attacker needed
BribeVault address is changed; users have ETH rewards
The fix
The bribeVault address should be made immutable and the setter removed, as the project confirmed they will do.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
This smart contract lets people claim rewards, and it uses a special address to mean 'ETH' (the native cryptocurrency). If the owner changes that special address, the contract will try to send the reward as if it were a regular token, which fails because the new address is not a token contract. So people who earned ETH rewards can no longer get them.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.