-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
function _compoundFees
does not allow user to supply deadline
#171
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-504
satisfactory
satisfies C4 submission criteria; eligible for awards
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Comments
code423n4
added
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
labels
Jun 20, 2023
c4-judge
added
the
primary issue
Highest quality submission among a set of duplicates
label
Jul 9, 2023
trust1995 marked the issue as primary issue |
This was referenced Jul 9, 2023
trust1995 marked the issue as satisfactory |
c4-judge
added
the
satisfactory
satisfies C4 submission criteria; eligible for awards
label
Jul 9, 2023
This was referenced Jul 9, 2023
0xLightt marked the issue as sponsor acknowledged |
c4-sponsor
added
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
and removed
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
labels
Jul 13, 2023
0xLightt marked the issue as sponsor confirmed |
c4-sponsor
added
the
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
label
Jul 13, 2023
trust1995 marked issue #504 as primary and marked this issue as a duplicate of 504 |
c4-judge
added
duplicate-504
and removed
primary issue
Highest quality submission among a set of duplicates
labels
Jul 25, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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-504
satisfactory
satisfies C4 submission criteria; eligible for awards
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Lines of code
https://github.com/code-423n4/2023-05-maia/blob/54a45beb1428d85999da3f721f923cbf36ee3d35/src/talos/TalosStrategyVanilla.sol#L148
Vulnerability details
Impact
Not allowing users to supply their own deadline could potentially expose them to sandwich attacks
Proof of Concept
In
_compoundFees
function ofTalosStrategyVanilla.sol
, User is providing liquidity to the pool but it does not allow user to include a deadline check and it is hardcoded toblock.timestamp
.In
_compoundFees
function ofTalosStrategyVanilla.sol
, user is providing liquidity to the pool but the deadline parameter is simply passed in as current block.timestamp in which transaction occurs. This effectively means that transaction has no deadline, which means that the transaction may be included anytime by validators and remain pending in mempool, potentially exposing users to sandwich attacks by attackers or MEV bots.Consider the following scenario:
Alice wants to provide liquidity 300 BNB token for 30 ETH and later sell the 1 ETH for 3000 DAI. She signs the transaction.
The transaction is submitted to the mempool, however, Alice chose a transaction fee that is too low for validators to be interested in including her transaction in a block. The transaction stays pending in the mempool for extended periods, which could be hours, days, weeks, or even longer.
When the average gas fee dropped far enough for Alice's transaction to become interesting again for miners to include it, her trade will be executed. In the meantime, the price of ETH could have drastically decreased and the DAI value of that output might be significantly lower. She has unknowingly performed a bad trade due to the pending transaction she forgot about.
An even worse way this issue can be maliciously exploited is through MEV:
The transaction is still pending in the mempool. Average fees are still too high for validators to be interested in it. The price of ETH has gone up significantly since the transaction was signed, meaning Alice would receive a lot more when the trade is executed.
Tools Used
Recommended Mitigation Steps
Allow users to supply their own deadline parameter within In
_compoundFees
function ofTalosStrategyVanilla.sol
Assessed type
Other
The text was updated successfully, but these errors were encountered: