Return to site
Return to site

Bug Deep Dive #20

User can lose all funds when creating or increasing compounded Maker position due to share inflation - $1196

· Bug Deep Dive
Section image

Each segment in the Ammplify protocol functions as vault for compounded Makers. This makes the classic first deposit share inflation attack possible for any range which doesn't have liquidity yet:

  1. User wants to deposit liquidity into some range;
  2. There is no Ammplify Maker liquidity in some segment of the range (or all range);
  3. Attacker front-runs the deposit with minimum deposit, donates to uniswap liquidity range to increase liquidity share price;
  4. User deposit proceeds, taking necessary amounts of token0 / token1 from the user, but minting user 0 liquidity shares due to rounding (liquidity owed to user is less than 1 and thus rounded down). Uniswap liquidity itself is still minted, but it now belongs to the "vault" (attacker);

As a result, attacker steals all the deposit of the user with user getting 0 liquidity shares for his assets, losing all deposited funds.
Note, that there is some protection by enforcing minimum target liquidity. However, it is not effective and can be bypassed, because it targets liquidity itself, not liquidity shares. This means that after depositing minimum liquidity and doing donation to the pool range, the liquidity share price increases by orders of magnitude.

Alpha: always check the first deposit attacker everywhere, and note that even if there are certain mitigations, they can often be bypassed.

Conclusion

This finding would earn you $1196, and is the common inflation attack, with a minor check that must be bypassed, so make sure to not only find it, but also write in detail all technicalities.

Full Report
Codebase

Subscribe
Previous
Bug Deep Dive #19
Next
Bug Deep Dive #21
 Return to site
Cookie Use
We use cookies to improve browsing experience, security, and data collection. By accepting, you agree to the use of cookies for advertising and analytics. You can change your cookie settings at any time. Learn More
Accept all
Settings
Decline All
Cookie Settings
Necessary Cookies
These cookies enable core functionality such as security, network management, and accessibility. These cookies can’t be switched off.
Analytics Cookies
These cookies help us better understand how visitors interact with our website and help us discover errors.
Preferences Cookies
These cookies allow the website to remember choices you've made to provide enhanced functionality and personalization.
Save