The _unstakeVested
function in the FjordStaking contract incorrectly uses msg.sender
instead of streamOwner
when calling points.onUnstaked()
. This error leads to the inability to properly reduce staked amounts when Sablier streams are canceled, allowing stream owners to continue accruing rewards even after their streams have been cancelled.
When unstake vested, the contract calls the onUnstaked
function of the FjordPoints contract with the msg.sender
address to reduce the staked amount recorded in the FjordPoints contract.
This function is called by onStreamCanceled
when a Sablier stream is canceled.
The use of msg.sender in _unstakeVested
causes the following issues:
When a stream is canceled, the call to points.onUnstaked()
fails because it's attempting to reduce the staked amount for the Sablier contract (msg.sender) rather than the actual stream owner.
Due to this failure, the stream owner's staked amount in FjordPoints remains unchanged.
Consequently, the stream owner continues to accrue rewards based on their original staked amount, even after their stream has been canceled.
It means that the stakedAmount of the stream owner is not reduced when the stream is canceled. And even though the stream is canceled, the stream owner can still earn Fjord point rewards as if the stream is still active.
Stream owners can continue to earn rewards without maintaining the required stake, leading to an unfair distribution of rewards
Stream senders could exploit this vulnerability by repeatedly creating and canceling streams to artificially inflate their reward accrual.
Manual
Modify the _unstakeVested
function to use the streamOwner
parameter instead of msg.sender
:
Indeed the `points.onUnstaked` should use the streamOwner instead of msg.sender as an input parameter. Impact: high - The vested stakers who got their streams canceled will keep on receiving rewards (points included) for the previously staked stream. Likelihood: low - whenever a Sablier stream sender decides to `cancel()` a recipient's stream
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.