Submitted by 0xlemon
https://github.com/code-423n4/2024-12-bakerfi/blob/main/contracts/core/VaultBase.sol#L251
https://github.com/code-423n4/2024-12-bakerfi/blob/main/contracts/core/VaultRouter.sol#L116
VaultRouter cannot be used for deposits when it reaches the maximum deposit limit because this contract is the msg.sender to the vault and it is treated as a depositor who has a limit.
When doing deposits to a vault from the VaultRouter the router does an external call to the vault meaning that in Vaults case msg.sender will be the router itself. The protocol, however, enforces a max deposit limit for depositors. This means that after the VaultRouter reaches the vaults getMaxDeposit() no one will be able to deposit to the vault using the router.
Since the vault looks at balanceOf(msg.sender) for the deposit limit, an attacker can use the router to deposit to the vault specifying the recipient to be the router itself and then immediately withdrawing in the same transaction so that his tokens wont be stolen. He can do that to reach VaultRouter deposit limit and now no one will be able to deposit through the router.
DoS of the routers deposit functionality
You can try to enforce the same deposit limit on the router level and give the router unlimited deposit limit
klau5 (warden) commented:
Dravee (judge) commented:
0xlemon (warden) commented:
Dravee (judge) commented:
shaflow2 (warden) commented:
0xlemon (warden) commented:
MrPotatoMagic (warden) commented:
Dravee (judge) commented:
chefkenji (BakerFi) disputed and commented:
BakerFi mitigated:
Status: Mitigation confirmed. Full details in the report from 0xlemon.
