Sablier

Sablier
DeFiFoundry
53,440 USDC
View results
Submission Details
Severity: medium
Invalid

sender can cancel the stream before cliff to rob the money from receiver

Summary

sender can cancel the stream before cliff to rob the money from receiver,
since before cliff, the _calculateStreamedAmount return 0.

Vulnerability Details

according to the describe about cliff:

Cliff
The cut-off point for releasing assets. Prior to the cliff, the recipient cannot withdraw, though assets continue to accrue in the stream.

though assets continue to accrue in the stream, which means this part of assets should belong to the receiver,
only after cliff, receiver can withdraw the rewards.

The issue is, sender can cancel the stream before cliff, and the _calculateStreamedAmount return 0,
whicih means receiver can not get any rewards once sender cancel the stream before cliff.

function _calculateStreamedAmount(uint256 streamId) internal view override returns (uint128) {
// If the cliff time is in the future, return zero.
uint256 cliffTime = uint256(_cliffs[streamId]);
uint256 blockTimestamp = block.timestamp;
if (cliffTime > blockTimestamp) {
@> return 0;
...

The part of asset accure in stream before cliff should belong to receiver,

Impact

The receiver can not get any rewards once sender cancel the stream before cliff.

Tools Used

manual

Recommendation

limit the ability of sender to cancel the stream before cliff

Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.