Skip to content
Business logic Audit finding Advanced

Swapping large amounts of assets back and forth in an Aerodrome pool allows to bypass exposure limits

PUSH0 Follow with zzykxx

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2024-04-arcadia-pricing-module-judging/issues/18

Found by

PUSH0, zzykxx

Summary

Swapping large amounts of assets back and forth in an Aerodrome pool allows to bypass exposure limits.

Vulnerability Detail

The WrappedAerodromeAM allows wrapping LPs of an Aerodrome pool to then deposit the wrapped position as collateral in an Arcadia account. The wrapper accounts for the trading fees accumulated by the LP when estimating the value of the collateral:

Solidity
(, uint256 positionId) = _getAssetFromKey(assetKey);
(uint256 fee0Position, uint256 fee1Position) = feesOf(positionId);

underlyingAssetsAmounts = new uint256[](3);
underlyingAssetsAmounts[0] = positionState[positionId].amountWrapped;
underlyingAssetsAmounts[1] = fee0Position;
underlyingAssetsAmounts[2] = fee1Position;

It's possible to take advantage of this to bypass exposure limits. An attacker can:

  1. Create a new Aerodrome pool
  2. Mint LPs, the attacker owns the whole liquidity supply
  3. Deposit the LP as collateral via WrappedAerodromeAM
  4. Swap large amounts in the Aerodrome pool back and forth to increase the fees accumulated by the LP. The value of the collateral increases while the collateral is already deposited. The attacker won't lose anything besides gas fees because he controls the whole (minues 1e3) liquidity supply.

An attacker can keep swapping amounts indefinitely. Because this is done while the collateral is already deposited in the account the attacker can avoid the restrictions of exposure limits.

Impact

Exposure limits can be bypassed.

Code Snippet

Tool used

Manual Review

Recommendation

A similar attack is possible on UniswapV3 positions, however in that case the protocol already implements safety guards against this possibility. Implement a similar safety guard for Aerodrome positions as well.

Discussion

sherlock-admin4

1 comment(s) were left on this issue during the judging contest.

shealtielanz commented:

exposure limits will truly be bypassed

sherlock-admin3

The protocol team fixed this issue in the following PRs/commits: https://github.com/arcadia-finance/accounts-v2/pull/201

sherlock-admin2

The Lead Senior Watson signed off on the fix.

The original report as published on Sherlock, by PUSH0. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is known

A medium-severity business logic bug in Arcadia - Aerodrome integrations. Sherlock made it public on 30 April 2024. Found in the 321 audit contest (finding M-2), also found by 1 other warden.

About Business logic

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

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.

More by PUSH0

View all

8 more disclosed reports, best first.

More from Arcadia - Aerodrome integrations

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.