Deflation attack
The SiloVault share price can be deflated by repeatedly depositing tiny amounts that mint shares without increasing total assets, because the market rounds away the deposited assets. An attacker could brick the vault or become the sole holder to capture incentive rewards.
Submitted by d3e4
Finding description and impact
The flow of assets between SiloVault and its markets favour the markets (per standard ERC4626 specifications). This means that SiloVault can lose assets compared to its total supply of shares. This deflates the share price. At low total asset levels, this can be exploited to deflate the share price until the shares per asset is close to overflowing.
This can be exploited to either simply brick the vault, or such that the attacker is the guaranteed sole holder and recipient of the incentive rewards.
Proof of Concept
The shares minted is calculated as _assets.mulDiv(_newTotalSupply + 10 ** _decimalsOffset(), _newTotalAssets + 1, _rounding), where the total assets is based on the redeemable value of all market shares held by SiloVault.
For example, the first depositor deposits 1 wei into SiloVault, which deposits this into a market, and mints 10 ** _decimalsOffset() shares. The market, however, is likely to round this away and not return any share to SiloVault. On the next deposit into SiloVault, totalAssets is zero, but 10 ** _decimalsOffset() shares were minted. Again depositing 1 wei mints 2 * 10 ** _decimalsOffset(), without increasing totalAssets. Each repetition doubles the total supply.
The same would, of course, happen if totalAssets on deposit did increase to 1 but due to the market updating its price, this later became 0.
Suppose SiloVault were to instead mint shares according to the increase in totalAssets. Then no shares would be minted in the above example. Suppose then instead 10 wei are deposited into SiloVault, which deposits this into a market, in return, for 8 market shares (let’s say the market’s price is 1.13 assets/share). This is redeemable for 9 asset tokens, so SiloVault mints 9 * 10 ** _decimalsOffset() shares. Now, redeeming 8 * 10 ** _decimalsOffset() shares from SiloVault makes SiloVault withdraw 8 asset tokens from the market. Withdrawing 8 asset tokens burns not 7.08 but all 8 market shares, and SiloVault is now, just as above, left with zero totalAssets but a total supply of 1 * 10 ** _decimalsOffset().
Recommended mitigation steps
Set the virtual assets to 10**DECIMALS_OFFSET (the same as the virtual shares, instead of the hardcoded 1). This acts as a virtual deposit which makes both the inflation attack and the attack described here infeasible. The only downside is that interest earned in the markets is effectively accrued also to the virtual deposit, for which reason, the virtual deposit should be chosen such that it is small in monetary value but still a large integer. Then the lost interest will be negligible.
IhorSF (Silo Finance) confirmed
The issue is confirmed however I’d argue it should not be a high severity. There is very low likelihood of this issue happening. Taking over empty vault has no point. If there is one legit deposit, even small, issue is gone. This is similar to inflation attack or first deposit attack that are not considered critical.
The PRs here and here only ensure that deposit does not generate zero shares.
Status: Unmitigated. Full details in reports from d3e4.
Code4rena judging staff adjusted the severity of Finding [M-06], after reviewing additional context provided by the sponsor.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the vault mints shares based on total assets but the underlying market rounds small deposits to zero, so repeated tiny deposits increase total supply without increasing total assets.
Impact
The vault could be bricked or the attacker could become the guaranteed sole holder and recipient of incentive rewards; the sponsor argued the likelihood is very low and taking over an empty vault has no point.
What the attacker needed
Vault has very low total assets; attacker can make repeated tiny deposits
The fix
Set the virtual assets to 10**DECIMALS_OFFSET (same as virtual shares) instead of hardcoded 1, which makes both inflation and deflation attacks infeasible; the sponsor's mitigation only ensured deposit does not generate zero shares and the issue remained unmitigated.
How it was found
- Deposit 1 wei into SiloVault, which mints 10 ** _decimalsOffset() shares but the market rounds the deposit away so totalAssets stays zero.
- Repeat the 1 wei deposit; each time totalAssets remains zero but total supply doubles.
- Continue until shares per asset is close to overflowing, bricking the vault or making the attacker the sole holder.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A vault holds money for many people and gives them shares representing their portion. If the vault's total money becomes zero while shares still exist, the value of each share drops to almost nothing. An attacker can cause this by making tiny deposits that create shares but no actual money in the vault, eventually breaking the vault or making themselves the only shareholder.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.