The withdraw function in sablierFlow.sol incorrectly subtracts the total amount from the aggregate token balance instead of subtracting just the net amount after deducting the protocol fee. This results in an inaccurate aggregate balance. This vulnerability is feasible because the collectProtocolRevenue function in the sablierflowbase.sol also goes ahead to subtract the fee amount from aggregate token balance during its own withdrawal leading to double subtraction from aggregate token balance
Here is the section of the withdraw function from sablierFlow.sol.
the function subtracts Total amount from aggregateTokenBalance
Here is the collectProtocolRevenue() in sablierFlowBase.sol which goes on to subtract the protocol fee from aggregate token balance again
The function subtracts the total amount from the aggregate balance instead of the net amount after deducting the protocol fee. This leads to an incorrect aggregate balance.
The incorrect balance update can cause financial discrepancies, affecting the accuracy of the contract’s financial records, where protocol can have less token than recorded
manual review
Modify the function to subtract the net amount from the aggregate balance after deducting the protocol fee. Or skip the reduction of aggregateToken balance by protocol fee in collectProtocolRevenue
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.