seizeLoan function in Lender.sol file, doesn't follow the CEI pattern and updates loans after an external call.
The implementation does not strictly follow the Checks-Effects-Interactions (CEI) pattern.
Malicious attackers and unsuspecting ecosystem participants can lend a loan with ERC-777 tokens (which have a callback that can take control) as collateral and in sieze a loan exploit this vulnerability.
A malicious user can drain a contract from loan.collateralToken with the following steps.
A user lend a loan.
sieze a loan
contract transfer collateral to loan.lender
as the loans and pools aren't updated
A user reenter again and get collateral again
drain a contract and steel all loan.collateralToken the from contract
change Pool outstanding deb
manual review
follow CEI pattern and update state changes before external call.
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.