You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 3, 2024. It is now read-only.
sherlock-admin opened this issue
Aug 30, 2023
· 0 comments
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelHighA valid High severity issueRewardA payout will be made for this issue
LMPVaultRouterBase incorrectly handle WETH transfer
Summary
Vulnerability Detail
Supplying ETH via msg.value doesn't work since native ETH gets wrapped by internal function _processEthIn then it will attempt to transfer WETH from user via pullToken which result in the assets being transfer twice (both ETH and WETH)
Impact
Incorrect implementation causes contract to not function properly and initial ETH sent will be stuck in router contract
Code Snippet
// handle possible eth_processEthIn(vault); // @audit - ETH being wrappedIERC20 vaultAsset =IERC20(vault.asset());
uint256 assets = vault.previewMint(shares);
pullToken(vaultAsset, assets, address(this)); // @audit - WETH being transferred in
sherlock-admin2
changed the title
Sunny Blonde Dragon - LMPVaultRouterBase incorrectly handle WETH transfer
0xComfyCat - LMPVaultRouterBase incorrectly handle WETH transfer
Oct 3, 2023
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelHighA valid High severity issueRewardA payout will be made for this issue
0xComfyCat
medium
LMPVaultRouterBase incorrectly handle WETH transfer
Summary
Vulnerability Detail
Supplying ETH via
msg.value
doesn't work since native ETH gets wrapped by internal function_processEthIn
then it will attempt to transfer WETH from user viapullToken
which result in the assets being transfer twice (both ETH and WETH)Impact
Incorrect implementation causes contract to not function properly and initial ETH sent will be stuck in router contract
Code Snippet
https://github.com/Tokemak/v2-core-audit-2023-07-14/blob/main/src/vault/LMPVaultRouterBase.sol#L29-L35
Tool used
Manual Review
Recommendation
skip pull WETH if WETH balance in contract as a result of wrapping is enough for
assets
amountDuplicate of #1
The text was updated successfully, but these errors were encountered: