Skip to content

Latest commit

 

History

History
29 lines (15 loc) · 1.12 KB

057.md

File metadata and controls

29 lines (15 loc) · 1.12 KB

moneyversed

high

Reentrancy vulnerability in registerLoan function

Summary

The registerLoan function mints an NFT token without applying the ReentrancyGuard. This could potentially allow a malicious contract to re-enter and exploit the function before the original call is completed.

Vulnerability Detail

In the LenderManager.sol contract, the registerLoan function is vulnerable to reentrancy attacks due to minting an NFT token without applying a ReentrancyGuard. A malicious contract could potentially re-enter and exploit the function before the original call is completed.

Impact

Potential for reentrancy attacks, leading to unexpected behavior or loss of funds.

Code Snippet

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

Tool used

Manual Review

Recommendation

Implement a reentrancy guard, such as the ReentrancyGuard from the OpenZeppelin library, to protect against potential reentrancy attacks. Ensure the contract's state is updated before interacting with external contracts or tokens to reduce the risk of reentrancy.