Part 2

Zaros
PerpetualsDEXFoundrySolidity
70,000 USDC
View results
Submission Details
Severity: high
Invalid

No Slippage Controls in Keeper-Side Swaps

Summary: Several keeper-only functions perform token swaps (via executeSwapExactInputSingle or executeSwapExactInput) without any minimum-out or slippage parameter checks. While these calls are restricted to “registered system keepers,” a malicious or compromised keeper could route trades at a grossly unfavorable price or via a malicious DEX Adapter, causing substantial losses to the protocol’s liquidity providers (LPs) or treasury.

Vulnerability Details:
Affected functions:

-MarketMakingEngine.convertMarketsCreditDepositsToUsdc(...)

-MarketMakingEngine.settleVaultsDebt(...)

-MarketMakingEngine.rebalanceVaultsAssets(...)

-FeeDistributionBranch.convertAccumulatedFeesToWeth(...)

Key Issue:
Keeper-only functions execute token swaps without enforcing minimum-output or slippage controls. This can allow a malicious or compromised keeper to set off swaps at highly unfavorable rates.

Impact:
Financial Impacts:** **Vaults, liquidity providers (LPs), or the protocol treasury can suffer significant losses in USDC/WETH (or other tokens) if swaps occur under manipulated conditions.
Systematic ** **Poor swap executions can indirectly ripple through the system, undermining overall protocol stability.

Tools Used:
Slither: for detecting issues like reentrancy gaps and validation oversights
Mythril:for simulating malicious inputs and attacking scenarios that might affect keeper-driven functions or arbitrary swap path inputs
Echidna:for generating tests that simulate various edge cases, ensuring that the contract behaves safely under a wide range of attack scenarios.

Recommendations:
Introduce a slippage or min-output parameter on all keeper-driven swap functions (similar to how user swaps in VaultRouterBranch use minAmountsOut).

Consider a time-limited price check or on-chain aggregator check to ensure the final swap rate is within a safe range.

Updates

Lead Judging Commences

inallhonesty Lead Judge
6 months ago
inallhonesty Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.