Closed sherlock-admin4 closed 4 months ago
The protocol team fixed this issue in the following PRs/commits: https://github.com/0xCedar/elfi-perp-contracts/pull/64
Invalid, lack required poc for reentrancy per sherlock rules
The Lead Senior Watson signed off on the fix.
newt
High
Reentrancy Vulnerability
Summary
The
transfer
function inTranferUtils.sol
contains a potential reentrancy vulnerability. Despite using a gas limit, the function makes an external call to transfer ERC-20 tokens without reentrancy protection. This could allow malicious contracts to exploit the reentrancy vulnerability.Vulnerability Detail
If the recipient of the tokens is a contract with a fallback or receive function, this external call could trigger reentrancy, allowing the contract to call back into the transfer function before the initial execution completes.
Impact
If exploited, a reentrancy attack could allow an attacker to repeatedly call the transfer function before the previous execution completes.
Code Snippet
https://github.com/sherlock-audit/2024-05-elfi-protocol/blob/main/elfi-perp-contracts/contracts/utils/TransferUtils.sol#L11-L19
Tool used
Manual Review
Recommendation
Add reentrancy guard.