Flow

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

Potential Reentrancy Attack in Revenue Collection

location: /src/abstracts/SablierFlowBase.sol

Description: The collectProtocolRevenue function transfers tokens after changing the state of the contract. This pattern is vulnerable to reentrancy attacks, especially if the safeTransfer function is called and the recipient is a malicious contract.

  • Code Reference:

protocolRevenue[token] = 0; // State change before transfer
token.safeTransfer(to, surplus); // External call

Impact:

  • A malicious contract could call collectProtocolRevenue recursively, leading to unexpected behavior and financial loss.

  • Recommendations:

    • Use a checks-effects-interactions pattern by first transferring the tokens and then updating the state variable. Alternatively, utilize reentrancy guards:

modifier nonReentrant() {
require(!reentrantStatus, "Reentrant call");
reentrantStatus = true;
_;
reentrantStatus = false;
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Lack of quality
inallhonesty Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Lack of quality

Support

FAQs

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