The LendingPool::borrow
function fails to enforce the protocol's liquidity buffer ratio, allowing users to borrow all available liquidity and potentially leaving the protocol unable to process withdrawals.
The protocol has a liquidityBufferRatio set to 20% (2000 basis points):
However, in the borrow function, while collateral checks are performed, there is no check to ensure the borrow respects the buffer ratio:
This allows borrowers to drain all liquidity from the protocol, even though 20% should be reserved as a buffer.
Example:
Total liquidity: 1000 tokens
Buffer requirement: 200 tokens (20%)
Maximum borrowable should be: 800 tokens
Current implementation allows borrowing all 1000 tokens
The lack of buffer check:
Allows complete drainage of protocol liquidity
Prevents protocol from maintaining required safety buffer
Could block withdrawals from depositors
Breaks core protocol features
Foundry
Add the following error to ILendingPool
Add buffer ratio check in borrow function:
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.