Skip to content

Latest commit

 

History

History
29 lines (15 loc) · 956 Bytes

044.md

File metadata and controls

29 lines (15 loc) · 956 Bytes

moneyversed

high

Reentrancy vulnerability in liquidateCollateral function

Summary

The liquidateCollateral function may be vulnerable to reentrancy attacks due to the transfer of collateral tokens before updating the state to BidState.Liquidated.

Vulnerability Detail

In the CollateralManager.sol file, the liquidateCollateral function transfers collateral tokens before updating the state to BidState.Liquidated. This could potentially make the function vulnerable to reentrancy attacks.

Impact

Potential loss of funds and compromised platform integrity due to reentrancy attacks.

Code Snippet

https://github.com/sherlock-audit/2023-03-teller/blob/main/teller-protocol-v2/packages/contracts/contracts/CollateralManager.sol#L268

Tool used

Manual Review

Recommendation

Implement the ReentrancyGuard from the OpenZeppelin library or use a similar mechanism to protect the liquidateCollateral function from reentrancy attacks.