Closed sherlock-admin4 closed 2 months ago
1 comment(s) were left on this issue during the judging contest.
Honour commented:
Invalid: misleading POC. requires supplier cooperation to work. supplier has to deposit twice with an amount (approx. malStartingBalabce/2) as combining both deposits into one would cause the attack to fail and even then the attackers profit is 1 wei(from the logs)
Jigsaw
High
Vault is susceptible to Inflation attack
Summary
CuratedVault.sol is susceptible to a form of inflation attack. The steps an attacker will take are as follows: https://github.com/sherlock-audit/2024-06-new-scope/blob/main/zerolend-one/contracts/core/vaults/CuratedVault.sol#L328
In typical vault donation attackers, the attacker exploits the calculation of assets/shares with a donation. This donation causes a legitimate deposit transaction to mint zero shares, effectively inflating the 1 share the attacker preminted. The above steps will cause a user's deposit to mint 0 shares, essentially forcing a user to donate assets. The attack, as I have found, will not be profitable at this stage. For the attack to be profitable, multiple deposits will be needed. The POC I have provided will show that an additional deposit of equal size + 2 will result in a profit for the attacker.
Root Cause
The ability to directly donate to a pool on behalf of a vault allows the share inflation to be attempted.
Internal pre-conditions
No response
External pre-conditions
No response
Attack Path
Impact
Users will be unable to mint shares with token amounts less than that of the initially front run deposit. Multiple users could mistakenly send deposit transactions and mint 0 shares. At minimum, the pool's share logic is broken and this attack is considered a griefing attack. If enough users deposit assets without minting shares, the attacker is able to redeem his 1 share for a net profit on the attack.
PoC
From ERC4626Test.sol:
Mitigation
I recommend not allowing deposits to pool on behalf of vaults.
Duplicate of #141