The Standard

The Standard
DeFiHardhat
20,000 USDC
View results
Submission Details
Severity: low
Invalid

No Zero Address Check in removeCollateralNative() Can lead to Loss of Fund

Summary

There is no zero address check, this can lead to the msg.sender sending ether to a zero address and causing loss of funds

Vulnerability Details

Sending Ethers to a zero address ((0x0000000000000000000000000000000000000000)) will not revert as the EVM treats the zero address as a normal address, it is best practice always to check the address the Ether is sent to before sending. Though, it does not affect the protocol directly it is best for the protocol to protect its users to make sure

Impact

This will lead to loss of funds for the msg.sender.

Tools Used

Manual Review

Recommendations

function removeCollateralNative(
    uint256 _amount,
    address payable _to
) external onlyOwner {
    require(
        canRemoveCollateral(getTokenManager().getToken(NATIVE), _amount),
        UNDER_COLL
    );
 ++   require(_to != address(0), "Invalid address");
    (bool sent, ) = _to.call{value: _amount}("");
    require(sent, "err-native-call");
    emit CollateralRemoved(NATIVE, _amount, _to);
}
Updates

Lead Judging Commences

hrishibhat Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Known issue
Assigned finding tags:

informational/invalid

Support

FAQs

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