When a Sablier stream is cancelled, the onStreamCanceled
function in FjordStaking
calls _unstakeVested
, which reduces the stake in the FjordPoints
contract. However, it uses msg.sender
(the Sablier contract) instead of the actual stream owner, leading to incorrect stake accounting and potential issues in the points system.
The wrong address (Sablier contract) will have its stake reduced in the FjordPoints
contract, while the actual user's stake remains unchanged.
However, since the Sablier contract address doesn't exist in the FjordPoints
contract's users
mapping, the onUnstaked
function might be DoS'd, preventing stream cancellations.
Here's a full flow of the Sablier stream cancellation:
Manual code review
Modify the FjordStaking::_unstakeVested
function to accept the stream owner's address as a parameter, and pass this address to the points.onUnstaked
call.
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.