code-423n4 / 2021-07-sherlock-findings

0 stars 0 forks source link

Missing zero address check for the recipient in `SherXERC20` #134

Closed code423n4 closed 3 years ago

code423n4 commented 3 years ago

Handle

shw

Vulnerability details

Impact

The transferFrom function of SherXERC20 checks the _from address to be non-zero, while the _to address is not checked. Neither the _from address nor the _to address is checked for the' transfer' function.

Proof of Concept

Referenced code: SherXERC20.sol#L105 SherXERC20.sol#L94-L97

Recommended Mitigation Steps

Consider adding non-zero address checks for the _from and _to addresses in the internal _transfer function instead of the transfer or transferFrom functions.

Evert0x commented 3 years ago

118