Referrer can drain ReferralFeePoolV0
The claimRewardAsMochi function did not reduce the user's reward balance after a claim, allowing a referrer to repeatedly claim the same reward and drain the fee pool.
Submitted by gzeon
Impact
function claimRewardAsMochi in ReferralFeePoolV0.sol did not reduce user reward balance, allowing referrer to claim the same reward repeatedly and thus draining the fee pool.
Proof of Concept
Did not reduce user reward balance at L28-47 in ReferralFeePoolV0.sol
Recommended Mitigation Steps
Add the following lines
rewards -= reward[msg.sender]; reward[msg.sender] = 0;
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
Likely the function updated no state to mark the reward as claimed, so the balance remained unchanged after each payout.
Impact
A referrer could claim the same reward repeatedly and drain the entire fee pool.
What the attacker needed
Be a referrer with a reward balance
The fix
The function should subtract the claimed reward from the user's balance and set it to zero before or after transferring funds.
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.
A smart contract function that pays out rewards forgot to subtract the paid amount from the user's balance. So the same reward could be claimed over and over, emptying the pool that holds funds for all referrers.
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.