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.
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.
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.
Manual Review, Solodit.
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.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.