20,000 USDC
View results
Submission Details
Severity: medium

Multiple checks-effects-interactions violations

Summary

This finding highlights concerns about a dangerous pattern used throughout the codebase that may eventually lead to exploitable scenarios against reentrant calls, especially if ERC777 tokens are used.

Vulnerability Details

If either the loanToken or the collateralToken is an ERC777 token, the recipient of the tokens can potentially reenter the system using the tokensReceived hook.

Impact

Since large parts of the Lender.sol smart contract are not guarded against reentrancy, the external call’s recipient may reenter and potentially perform malicious actions that can impact the overall accounting and, thus, system funds.

Tools Used

Manual Review, Solodit.

Recommendations

Consider following the checks-effects-interactions pattern and adjusting any contract state variables before making external calls. It might also be a good idea to add a nonReentrant modifier to the functions, since contracts that accept ERC777 have been known to be exploited while following this pattern.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.