Skip to content
This repository has been archived by the owner on Mar 3, 2024. It is now read-only.

0x3b - LMPVaultRouterBase will charge a user 2x the deposit amount #188

Closed
sherlock-admin opened this issue Aug 29, 2023 · 0 comments
Closed
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label High A valid High severity issue Reward A payout will be made for this issue

Comments

@sherlock-admin
Copy link
Contributor

sherlock-admin commented Aug 29, 2023

0x3b

high

LMPVaultRouterBase will charge a user 2x the deposit amount

Summary

If a user uses ETH to mint/deposit in LMPVaultRouterBase, it will pull 2x the deposit amount from the user, while supplying him with 1x the tokens.

Vulnerability Detail

When using ETH in LMPVaultRouter to mint or deposit (bolt are in LMPVaultRouterBase) it first pulls the ETH into the contract and then pulls the baseAsset (ex. WETH) with PeripheryPayments, where recipient is address(this) and from is msg.sender. However as you can see firstly ETH is pulled from this user and then WETH.

  • If the user is lacking in WETH the TX will revert
  • If he has enough WETH he will be charged twice for the same amount of tokens.

Impact

User is charged 2x if he uses ETH to funds the Vault.

Code Snippet

https://github.com/sherlock-audit/2023-06-tokemak/blob/main/v2-core-audit-2023-07-14/src/vault/LMPVaultRouterBase.sol#L23-L57

Tool used

Manual Review

Recommendation

Either remove the ETH method or make it in a way so that it pull the WETH from the contract.

Duplicate of #1

@github-actions github-actions bot added High A valid High severity issue Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label labels Sep 11, 2023
@sherlock-admin2 sherlock-admin2 changed the title Crazy Lace Nuthatch - LMPVaultRouterBase will charge a user 2x the deposit amount 0x3b - LMPVaultRouterBase will charge a user 2x the deposit amount Oct 3, 2023
@sherlock-admin2 sherlock-admin2 added the Reward A payout will be made for this issue label Oct 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label High A valid High severity issue Reward A payout will be made for this issue
Projects
None yet
Development

No branches or pull requests

2 participants