Open hats-bug-reporter[bot] opened 5 months ago
The function multiTokenDepositFor includes a check to verify if the user for whom the deposit is being made is whitelisted. For withdrawals, no whitelist check is required, as anyone holding a token should be able to withdraw.
@0xfuje
Github username: @0xfuje Twitter username: 0xfuje Submission hash (on-chain): 0x683539dba401843200192eb8ca7bd4a584fd75aa33808bc441ff41021b7102d5 Severity: medium
Description:
Impact
Access control bypass: anyone can bypass the whitelist when depositing or withdrawing when the batch contracts are enabled to interact with the vaults
Description
The problem is this that if the
DepositBatch
andWithdrawBatch
contracts are allowed to interact with a vault via whitelisting them, it removes the barrier to restrict only whitelisted users to interact with the contracts, since they use a direct call withmultiTokenDepositFor()
/multiTokenWithdrawalFor()
for interacting with the vaults.DepositBatch.sol
-multiTokenSwapAndTransfer()
Recommendation
Consider to use a solution that makes the user the
msg.sender
(e.g.delegatecall
, but be wary of it's dangers) formultiTokenDepositFor
andmultiTokenWithdrawalFor
calls. This will ensure the batch contracts can't be used to bypass the whitelist.