Missing deadline check in few functions #147
Labels
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
duplicate-139
grade-a
Q-07
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
🤖_63_group
AI based duplicate group recommendation
Lines of code
https://github.com/code-423n4/2024-02-hydradx/blob/main/HydraDX-node/pallets/stableswap/src/lib.rs#L551-L842
Vulnerability details
Impact
Missing deadline check
Proof of Concept
Few functions don't have deadline parameter. This parameter can provide the user an option to limit the execution of their pending transaction.
Without a deadline parameter, users can execute their transactions at unexpected times when market conditions are unfavorable.
Function like
do_add_liquidity()
,do_add_liquidity_shares()
,remove_liquidity_one_asset
,withdraw_asset_amount()
,sell()
orbuy()
need to have deadline check.However, this is not a big problem in this case because the functions have slippage protection. Even though the users will get at least as much as they set, they may still be missing out on positive slippage if the exchange rate becomes favorable when the transaction is included in a block.
Similar report in code4rena and the explanation why this is medium even though it has slippage protection: code-423n4/2023-08-pooltogether-findings#126 (comment)
Tools Used
Visual Studio Code
Recommended Mitigation Steps
Introduce a
deadline
parameter in these functions.Assessed type
MEV
The text was updated successfully, but these errors were encountered: