Flow

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

Delegatecall Risks

Contract: Batch.sol

Description: The batch function uses delegatecall to execute calls to the current contract. This is risky because it executes the code of another contract in the context of the calling contract, potentially allowing the called contract to manipulate the state of the calling contract unexpectedly.

  • Code Reference:

(bool success, bytes memory result) = address(this).delegatecall(calls[i]);

Impact:

  • An attacker can exploit the batch function by submitting malicious payloads that alter the contract's state or drain funds.

  • Delegatecall can lead to vulnerabilities such as reentrancy, especially if the called functions are not properly vetted.

  • Recommendations:

    • Implement a whitelist of functions that can be called via the batch function. This ensures that only trusted functions can be executed.

require(isWhitelisted(functionSignature), "Function not whitelisted");

Alternatively, consider using call instead of delegatecall unless the intention is specifically to maintain state across calls.

Updates

Lead Judging Commences

inallhonesty Lead Judge 8 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.