Skip to content
Business logic Audit finding Intermediate

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.

kirk-baird Follow

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 bribeVault immutable 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 bribeVault from 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 bribeVault immutable will provide the stronger guarantees.


The original report as published on Code4rena, by kirk-baird. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

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.

More by kirk-baird

View all

32 more disclosed reports, best first.

More from Redacted Cartel contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.