Rewards can be lost
Originally disclosed on Code4rena
Submitted by csanuragjain
Reward can be lost if bribeVault calls the updateRewardsMetadata on same rewardIdentifier again before user can claim his reward (since merkleRoot and proof will get updated).
Proof of Concept
- bribeVault calls the updateRewardsMetadata at RewardDistributor.sol#L97 using rewardIdentifier X
- Assume _distributions[i].proof contains merkle proof for User A
- User A fails to call claim function
- bribeVault again calls the updateRewardsMetadata at RewardDistributor.sol#L97 using rewardIdentifier X updating _distributions[i].proof which might not contain merkle proof of User A now. So User A loses his rewards
Recommended Mitigation Steps
bribeVault should only make second call to updateRewardsMetadata on same rewardIdentifier when all claimers have made their claims.
kphed (Redacted Cartel) disputed and commented:
We would only call
updateRewardsMetadataagain if there was an issue with the originally-set merkle root(s). The recommended mitigation steps above would block us from setting the correct merkle roots until after claimers claimed the wrong amounts.Thanks again for participating in our contest csanuragjain, looking forward to more feedback/suggestions/comments.
Alex the Entreprenerd (judge) commented:
The finding highlights the consequences of admin privilege, in that the admin can use
updateRewardsMetadatato deny claims.While I believe the warden could have done a better job at expressing the risks involved for users, I believe the finding to be valid.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is known
A medium-severity business logic bug in Redacted Cartel contest. Code4rena made it public on 11 May 2022. Found in the 2022-02-redacted-cartel audit contest (finding M-18).
About Business logic
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
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.