Skip to content

Latest commit

 

History

History
40 lines (22 loc) · 1.5 KB

006.md

File metadata and controls

40 lines (22 loc) · 1.5 KB

Dry Honey Huskie

Medium

User will lose tokens due to hardcoded slippage

Summary

In the Proof-of-Stake (PoS) model, proposers have advanced knowledge of whether they will propose a single block or a series of consecutive blocks. In this context, a malevolent validator can delay a transaction and choose to execute it at a more opportune block number.

Root Cause

There is a hardcoded slippage for the minimum number of tokens and deadline. Swap can be maliciously executed later, user can face up with the loss when the value of token change. In the worst scenario, vault can be liquidated because of the swap.

https://github.com/sherlock-audit/2024-10-axion/blob/3704f19ea52ebe255861ded3da0d3648c764fb69/liquidity-amo/contracts/SolidlyV3AMO.sol#L308C1-L315C1

Internal pre-conditions

No response

External pre-conditions

Attack Path

  1. User/AMO bot call mintSellFarm()
  2. Sandwich Attack
  3. User lose tokens

Impact

Minimum number of tokens is 1.This provides no safeguard since block.timestamp + 1 will reflect the timestamp of the block in which the transaction is included. Consequently, malicious validators can indefinitely withhold the transaction.

The vulnerability increases the risk of inefficient or failed token swaps due to potential sandwich attack. This may result in financial losses and negatively impact the reliability of the contract's token swapping functionality.

PoC

No response

Mitigation

Allow users to specify minimum amount of tokens and deadline.