code-423n4 / 2022-03-lifinance-findings

6 stars 4 forks source link

Potential reentrancy vulnerability in AnyswapFacet #91

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Lines of code

https://github.com/code-423n4/2022-03-lifinance/blob/main/src/Facets/AnyswapFacet.sol#L35-L66

Vulnerability details

Impact

Without the whitelist and lock, this contract has potential reentrancy vulnerability.

Proof of Concept

startBridgeTokensViaAnyswap does not perform a whitelist judgment on the token address, and the contract does not have a reentrant lock. At LibAsset.transferFromERC20, an attacker can custom construct a malicious transferFrom function of ERC20 contract to perform a reentrancy attack on the startBridgeTokensViaAnyswap contract.

Tools Used

Recommended Mitigation Steps

H3xept commented 2 years ago

Duplicate of #109

gzeoneth commented 2 years ago

While the reentrancy is valid there are no exploit, changing to Med Risk.