sherlock-audit / 2024-06-boost-aa-wallet-judging

3 stars 1 forks source link

0xlookman - `BoostCore::_routeClaimFee` can be Dosed by any of the first Recipients before the `protocolFeeReceiver` during a claim leading to a loss of funds #424

Open sherlock-admin4 opened 2 months ago

sherlock-admin4 commented 2 months ago

0xlookman

Medium

BoostCore::_routeClaimFee can be Dosed by any of the first Recipients before the protocolFeeReceiver during a claim leading to a loss of funds

0xlookman

Medium

Summary

The claim process of the claim fee in BoostCore::_routeClaimFee might be Dosed by either a malicious boost owner or referrer, breaking the protocol's core functionality. This would also result in fee loss for the protocol as protocol fees won't be collected.

Vulnerability Detail

In BoostCore::claimIncentiveFor when claiming an incentive, the BoostCore::_routeClaimFee is called to distribute claimFees among all recipients.

       function claimIncentiveFor(
        uint256 boostId_,
        uint256 incentiveId_,
        address referrer_,
        bytes calldata data_,
        address claimant
    ) public payable nonReentrant {
        BoostLib.Boost storage boost = _boosts[boostId_];
        if (msg.value < claimFee)
            revert BoostError.InsufficientFunds(
                address(0),
                msg.value,
                claimFee
            );
        _routeClaimFee(boost, referrer_);

Impact

When a fee recipient decides to maliciously revert, all the other recipients will loss their share of the fee as they won't receive their share.

Code Snippet

Tool used

Manual Review

Recommendation

Consider using a pull method for recipients to claim their share instead of transferring the fee directly to them during claiming in the BoostCore::_routeClaimFee .