Submitted by SpicyMeatball, also found by 056Security, d3e4, DanielArmstrong, Dulgiq, and Rampage
https://github.com/code-423n4/2025-03-silo-finance/blob/main/silo-vaults/contracts/SiloVault.sol#L879
Some vaults that the Silo vault deposits into have their own supply caps (do not confuse with config[market].cap), which may prevent _supplyERC4626 from fully depositing user-provided assets. If these caps are not accounted for, the deposit function may revert instead of distributing assets across multiple vaults.
Consider a scenario where there are two vaults available for deposits:
In total, 10,000 assets of deposit space are available. However, if a user tries to deposit 10,000 assets through the Silo vault, _supplyERC4626 is called:
The function will first attempt to deposit 10,000 assets into Vault 1, but since vault1.maxDeposit < 10,000, the transaction will revert. The same issue occurs with Vault 2, causing the entire deposit operation to faileven though sufficient space exists across both vaults.
To avoid this issue, the function should check market.maxDeposit before attempting a deposit, similar to how it is handled in the _maxDeposit function:
In the _supplyERC4626 function:
With this fix, the Silo vault will distribute deposits correctly:
This prevents unnecessary reverts and ensures that all available deposit space is properly utilized.
IhorSF (Silo Finance) confirmed
Silo Finance mitigated:
Status: Mitigation confirmed. Full details in reports from d3e4, t0x1c, and Drynooo.
