Execution of swaps
in the before bridging operation
and in the same-chain txs lacks deadline
#608
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate-24
edited-by-warden
insufficient quality report
This report is not of sufficient quality
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2024-01-decent/blob/main/src/swappers/UniSwapper.sol#L58-L77
https://github.com/code-423n4/2024-01-decent/blob/main/src/swappers/UniSwapper.sol#L123-L169
Vulnerability details
Proof of Concept
In
UniSwapper.sol
, part of the Decent protocol, swaps are executed as part of the token exchange process. This contract interacts with Uniswap or similar decentralized exchanges (DEXs) to perform token swaps. However, the execution of these swaps, particularly before bridging operations and in same-chain transactions, does not include a deadline parameter. In typical DEX interactions, a deadline is used to specify the time by which a swap must be completed, providing a safeguard against unfavorable changes in market conditions or potential manipulation.In the
UniSwapper.sol
contract, functions that interact with DEXs for swapping tokens (e.g.,swapExactIn
,swapExactOut
) do not include a deadline parameter. This can be confirmed by reviewing the contract code and noting the absence of a time-bound condition for swap execution.Impact
The absence of a deadline in swap transactions can lead to several issues:
The issue presents a clear risk in terms of potential financial losses and exploitation through market manipulation. However, it does not directly lead to immediate loss of funds or critical contract failures. The severity could be higher in scenarios where the market is highly volatile, or the protocol is heavily utilized, increasing the likelihood of exploitation.
Tools Used
Manual code review
Recommendations
To mitigate the risks associated with the lack of a deadline in swap operations, consider the following recommendations:
UniSwapper.sol
to include a deadline parameter. This parameter should be passed along to the DEX interface to ensure that swaps are only executed within the specified time frame.Assessed type
Other
The text was updated successfully, but these errors were encountered: