The LendingPool contract's borrow function lacks proper sequencing of validation checks. The collateral verification occurs after state changes, creating a race condition where users can borrow without adequate backing. A user without any collateral can successfully call borrow()
despite the protocol's requirement for collateralized loans.
The LendingPool's borrow function contains validation checks that should prevent borrowing when:
The collateral validation is implemented as an if-statement
that reverts, this check can be bypassed in certain states. The validation occurs after state changes, allowing the malicious attacker to manipulate the execution flow between the collateral check and actual borrowing. When a user requests a loan, the contract should verify their collateral value before allowing any borrowing. However, the current implementation performs these checks after critical state changes.
The LendingPool contract performs collateral validation after critical state changes, creating a window where the validation can be bypassed. The proper sequence should validate all requirements before any state modifications.
A malicious user could:
Call borrow()
with a non-zero amount
The contract checks isUnderLiquidation
status
Retrieves user's collateral value
Due to improper validation ordering, the borrowing succeeds despite zero collateral
This enables undercollateralized borrowing, directly threatening the protocol's solvency and potentially leading to bad debt accumulation in the lending pool.
includes:
Protocol insolvency risk as loans lack proper backing
Manipulation of lending pool reserves
Destabilization of the protocol's economic model
Implement strict validation ordering
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.