-
Notifications
You must be signed in to change notification settings - Fork 8
Ch_301 - Swap fees will lead the withdraw to revert #328
Comments
Escalate I do not consider this submission a duplicate of #519, which demonstrates an arithmetic underflow error rendering withdrawals impossible. While this submission here is very vague, it highlights an issue in https://github.com/sherlock-audit/2023-06-tokemak/blob/main/v2-core-audit-2023-07-14/src/vault/LMPVault.sol#L416-L418, reverting if the withdrawn assets are less than the anticipated withdrawal amount. However, due to the lack of detail in the submission, I have a hard time evaluating the validity of this finding here. Edit: This submission here is likely rather a duplicate of #289 |
You've created a valid escalation! To remove the escalation from consideration: Delete your comment. You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final. |
@Trumpero any comment on this? |
I agree with the escalation that this issue isn't a duplicate of #519; I believe it is similar to #450. It doesn't have a detailed description, and the summary doesn't mention the risk of a revert due to underflow in the subtraction. The PoC describes a revert with the reason 'TooFewAssets' in the 'withdraw' function, which is intended by the protocol for this function and shouldn't be considered a valid vector (as commented on #450) |
Yeah, this isn't a dup of #519. But also not similar to #450 at all, it talks about receiving a lower amount than expected due to the Oracle price. However, This issue reverts with 'TooFewAssets' in the 'withdraw' function, but you need to mention why (I left the Vulnerability Detail empty by mistake) then you can decide if it a intended by the protocol or not. This check is correct and should stay there to make sure that the function Everyone in this space knows that every swap needs to pay a swap fee and this is what I show in the POC by reducing one wei from the Pulled Asset to simulate the swap fees. This is not an issue with future integrations You can check the Also, the sponsor says |
@Ch-301 Both the |
1 - This issue is not about slippage. |
@Ch-301 If the withdrawal doesn't utilize any swap (withdraw directly from idle) or the swaps during withdrawals don't incur any slippage, it implies that There are multiple tests of the protocol that don't result in a revert when calling the withdraw function of LMPVault. For instance, you can check this: https://github.com/sherlock-audit/2023-06-tokemak/blob/main/v2-core-audit-2023-07-14/test/vault/LMPVault-Withdraw.t.sol#L850-L876. Therefore, if users want to avoid unexpected reverts, they should use the |
Additionally, this issue lacks vulnerable details, and all the information from the summary and PoC revolves around the revert in the withdraw function, which is similar to #450. The statement 'The fact that any swap has swap fees and some slippage' in the report isn't correct, as there are rare instances of swaps that return more than the expected amount of the oracle price (called positive slippage). The I would prefer not to continue discussing this matter further. |
Planning to accept escalation and duplicate with 450 |
Result: |
Escalations have been resolved successfully! Escalation status:
|
Ch_301
medium
Swap fees will lead the withdraw to revert
Summary
This issue is a result of two problems
1- This check
2- The fact that any swap has swap fees and some slippage, so the max here is always
info.debtDecrease
Vulnerability Detail
Impact
withdraw()
to get their funds from the LMP VaultCode Snippet
Please copy the following POC in
LMPVault-Withdraw.t.sol
Tool used
Manual Review - Foundry
Recommendation
Duplicate of #450
The text was updated successfully, but these errors were encountered: