Sparkn

CodeFox Inc.
DeFiFoundryProxy
15,000 USDC
View results
Submission Details
Severity: low
Valid

Low level `.call()` in `_distribute()` does not check for contract existence, can fail silently

Summary

Low level calls can fail silently, functions should always check for contract existence before making external calls

Vulnerability Details

The low-level functions call, delegatecall and staticcall return true as their first return value if the account called is non-existent, as part of the design of the EVM. Account existence must be checked prior to calling if needed.

function _distribute(address proxy, bytes calldata data) internal {
(bool success,) = proxy.call(data);
if (!success) revert ProxyFactory__DelegateCallFailed();
emit Distributed(proxy, data);
}

In the code above the call on the proxy can fail silently by returning true as it's first value even if Proxy contract Does not exist yet.

Please find More details in the documentation here: https://docs.soliditylang.org/en/develop/control-structures.html#error-handling-assert-require-revert-and-exceptions

Impact

In case of improper deployment of the proxy calls made will return true even if contract does not exist which is not the desired effect.
This can cause low level calls to fail silently.

Tools Used

Manual Review

Recommendations

Functions should check for existence of contract before Low level calls.

Support

FAQs

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