HardhatFoundry
30,000 USDC
View results
Submission Details
Severity: low
Invalid

External Call Faluire Checks Are Missing

Summary

The codebase lacks failure checks for external calls using Low-level Call Functions (call, delegatecall, staticcall, send, and transfer). To comply with EEA EthTrust Security Level [S], it is essential to explicitly check the return values of these calls to detect and handle failures appropriately.

Vulnerability Details

Throughout the codebase, there are instances where failure checks for external calls are missing:

  • File: contracts/base/BaseAccount.sol

    • Line: Various

      if iszero(call(gas(), entryPointAddress, callvalue(), codesize(), 0x00, codesize(), 0x00)) {
      if iszero(call(gas(), entryPointAddress, 0, 0x10, 0x44, codesize(), 0x00)) {
      staticcall(gas(), entryPointAddress, 0x1c, 0x24, 0x20, 0x20);
  • File: contracts/base/ExecutionHelper.sol

    • Line: Various

      if iszero(call(gas(), target, value, result, callData.length, codesize(), 0x00)) {
      success := call(gas(), target, value, result, callData.length, codesize(), 0x00);
      if iszero(delegatecall(gas(), delegate, result, callData.length, codesize(), 0x00)) {
      success := delegatecall(gas(), delegate, result, callData.length, codesize(), 0x00);

The absence of explicit checks on the return values from these calls may result in unexpected behavior in the calling contracts, potentially leading to security vulnerabilities.

Impact

Failure to check the return values of Low-level Call Functions (call, delegatecall, staticcall, send, and transfer) can have serious implications:

  • Unexpected Behavior: Calls that fail silently due to unhandled exceptions or errors may lead to unintended contract behaviors.

  • Security Vulnerabilities: Malicious actors could exploit these unchecked calls for reentrancy attacks, unauthorized state changes, or fund loss scenarios.

Tools Used

  • Manual code review

Recommendations

To mitigate the risks associated with missing failure checks in external calls, adhere to the following recommendations:

  1. Implement Explicit Failure Checks:

    • Ensure that each external call using Low-level Call Functions (call, delegatecall, staticcall, send, transfer) is followed by a check to validate the success or failure of the call.

  2. Handle Exceptions Appropriately:

    • Implement try/catch mechanisms or error handling strategies to manage exceptions and errors that may occur during external calls.

  3. Use Safe External Call Patterns:

    • Consider using higher-level libraries or design patterns (such as the Checks-Effects-Interactions pattern) that incorporate safe external call practices.

By implementing these recommendations, the codebase can enhance its resilience against potential security vulnerabilities associated with unchecked external calls.

Updates

Lead Judging Commences

0xnevi Lead Judge
11 months ago
0xnevi Lead Judge 11 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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