Closed code423n4 closed 2 years ago
Updated per warden to link to another issue submitted.
Duplicate of #137
Agree with sponsor this does not pose a functional risk. Changing to Low/QA.
Consider with #81
This should be a duplicate of #75 instead, I made a mistake during the deduplication process.
Lines of code
https://github.com/code-423n4/2022-03-lifinance/blob/699c2305fcfb6fe8862b75b26d1d8a2f46a551e6/src/Facets/GenericSwapFacet.sol#L30
Vulnerability details
Impact
A faulty input in
GenericSwapFacet.swapTokensGeneric()
could cause funds to get stuck in the contract.In addition, tokens left in the LiFi contract can be retrieved by anyone (see issue: ERC20 withdrawals can be frontrun), leading to loss of fund.)
Proof of Concept
swapTokensGeneric()
, inputting WETH aslifiData.receivingAssetId
, USDC asswapData.sendingAssetId
, and USDT asswapData.receivingAssetId
.Recommended Mitigation Steps
Ensure that
lifiData.receivingAssetId
is equal toreceivingAssetId
of the final_swapData
.