Flow

Sablier
FoundryDeFi
20,000 USDC
View results
Submission Details
Severity: low
Invalid

Missing Zero Address Validation in collectProtocolRevenue

Impact

The collectProtocolRevenue function lacks a zero address validation check for the to parameter. This could lead to permanent loss of protocol revenue if an admin accidentally provides address(0) as the destination address.

If the admin mistakenly passes address(0) as the to parameter:

  1. The function will execute without reverting

  2. The protocol revenue will be reduced to 0: protocolRevenue[token] = 0

  3. The tokens will be transferred to the zero address

  4. These tokens will be permanently lost as the zero address is inaccessible

https://github.com/Cyfrin/2024-10-sablier/blob/8a2eac7a916080f2022527408b004578b21c51d0/src/abstracts/SablierFlowBase.sol#L207

Recommendations

Add a zero address validation check at the beginning of the function

if (to == address(0)) {revert Errors.InvalidAddress(); // Custom error recommended}
Updates

Lead Judging Commences

inallhonesty Lead Judge 8 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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