Closed sherlock-admin4 closed 8 months ago
2 comment(s) were left on this issue during the judging contest.
panprog commented:
invalid, this is user mistake and external (e.g. USDC) blacklisted addresses issues are invalid in sherlock
takarez commented:
invalid
Chad0
high
Inadequate checking on the arbitrary
receiver
address given to the externaldeposit
function introduces compliance risks of contaminating the protocol & users' addressesSummary
Inadequate checking on the arbitrary
receiver
address given to the externaldeposit
function introduces compliance risks of contaminating the protocol & users' addresses.Vulnerability Detail
In Line#324 of the
Vault.sol
, the contract has an externaldeposit
function which is meant to let the users deposit theirbaseToken
(USDC
for example) into the vault. This function is designed to allow any user to specify any arbitrary address as thereceiver
, so that thisreceiver
address becomes the beneficiary and can receive shares, and can later interact with the protocol to redeem shares, to withdraw fund...etc.However, in the function there is not adequate checking performed on this arbitrary
receiver
input, so it can introduce various types of risks to the protocol. To name a few:baseToken
protocols like USDC or USDT as thereceiver
, hence creating frequent downstream interactions from such a bad address with theVault
address. It can lead to theVault
address being contaminated and also added to the blacklists of USDC/USDT..etc. What's worse, if the top or most frequent users ofVault
also got their addresses blacklisted as a chain of contamination, then that would be a catastrophic situation. Such an attack is easy to implement, and can possibly grow into a quite severe impact on the protocol and the users, so I deem the severity of this issue as HIGH.receiver
before they use their contracts to interact with theVault
contract, so that the address(0) is accidentally used as thereceiver
.Impact
Code Snippet
https://github.com/sherlock-audit/2024-02-smilee-finance/blob/main/smilee-v2-contracts/src/Vault.sol#L324
Tool used
Manual Review
Recommendation
receiver
that, revert the trxn if the return istrue
from theisBlacklisted
function of thebaseToken
(USDC, USDT...etc.)receiver
is address(0).