Project

One World
NFTDeFi
15,000 USDC
View results
Submission Details
Severity: low
Invalid

Lacks zero address check in MembershipERC1155::callExternalContract function

Summary

the purpose of the callExternalContractfunction in the MembershipERC1155is to call other contracts but the function does not check for zero address during the function call.

Vulnerability Details

function callExternalContract(address contractAddress, bytes memory data)
external
payable
onlyRole(OWP_FACTORY_ROLE)
returns (bytes memory)
{
//Does no check if the contractAddress is zero address
(bool success, bytes memory returndata) = contractAddress.call{value: msg.value}(data);
require(success, "External call failed");
return returndata;
}

Tools Used

manual review

Recommendations

function callExternalContract(address contractAddress, bytes memory data)
external
payable
onlyRole(OWP_FACTORY_ROLE)
returns (bytes memory)
{
+ if (contractAddress == address(0)) revert CannotBeZeroAddress();
(bool success, bytes memory returndata) = contractAddress.call{value: msg.value}(data);
require(success, "External call failed");
return returndata;
}
Updates

Lead Judging Commences

0xbrivan2 Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
0xbrivan2 Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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

Give us feedback!