Low level call returns true if the address doesn't exist #301
Labels
bug
Something isn't working
disagree with severity
Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments)
invalid
This doesn't seem right
resolved
Finding has been patched by sponsor (sponsor pls link to PR containing fix)
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
Lines of code
https://github.com/code-423n4/2022-05-aura/blob/4989a2077546a5394e3650bf3c224669a0f7e690/convex-platform/contracts/contracts/BoosterOwner.sol#L187
https://github.com/code-423n4/2022-05-aura/blob/4989a2077546a5394e3650bf3c224669a0f7e690/convex-platform/contracts/contracts/StashFactoryV2.sol#89
https://github.com/code-423n4/2022-05-aura/blob/4989a2077546a5394e3650bf3c224669a0f7e690/convex-platform/contracts/contracts/StashFactoryV2.sol#95
https://github.com/code-423n4/2022-05-aura/blob/4989a2077546a5394e3650bf3c224669a0f7e690/convex-platform/contracts/contracts/StashFactoryV2.sol#101
Vulnerability details
As written in the documentation, 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. The low-level function
call
is used in some places in the code and it can be problematic. For example, in theexecute
of theBoosterOwner
contract there is a low level call in order to call the target function, but if the given_to
address doesn't existsuccess
will be equal to true and the function will return true and the code execution will be continued like the call was successful.function execute( address _to, uint256 _value, bytes calldata _data ) external onlyOwner returns (bool, bytes memory) { require(_to != booster, "!invalid target"); (bool success, bytes memory result) = _to.call{value:_value}(_data); return (success, result); }
Another place that this can happen is in the
CreateStash
function of theStashFactoryV2
contract, where there are low levels calls when calling theIsV1
,IsV2
andIsV3
functions.If the
_gauge
address doesn't exist, the call will return true and the function will act like the address exists and true is supposed to be returned.The text was updated successfully, but these errors were encountered: