Deposit-cap bypass
Description
The _beforeDeposit function verifies if the depositor is whitelisted and if the deposit amount is within the deposit cap. However, there are two issues with the current implementation:
The
receiveraddress is not checked against the whitelist. This allows a depositor to use multiple receiver accounts to bypass thedepositCapPerUserlimit.Even if the
receiveris whitelisted initially, the_update,claim, andwithdrawfunctions do not verify whitelist status. This means a depositor can transfer their shares to any account to bypass the deposit cap after the initial deposit.
if (_isWhitelistMode() && !_isWhitelisted(depositor)) {
revert NotWhitelisted(depositor);
}
// [...]
if (balanceOf(receiver) + scaledAmount > depositCapPerUser) {
revert DepositCapPerUserExceeded(amount, _vaultConfig.depositCapPerUser);
}Impact
The deposit-cap mechanism can be bypassed by using multiple accounts, allowing unauthorized users to claim rewards and withdraw funds from the vault.
Recommendations
We recommend the following.
Add whitelist verification for the
receiveraddress in the_beforeDepositfunction.Implement whitelist checks in the
_updatefunction to ensure only whitelisted accounts can interact with the vault.
Remediation
River also provided the following response to this issue:
This is the expected behavior by design.