In theory, the lender should only be able to seize the collateral if the loan has finished its auction. But the lender is able to speed up the process and seize the collateral almost immediately by setting the pool.auctionLength when setPool()
Despite having zero number check on the auctionLength, the setPool() function lacks minimum auctionLength declaration. This can be manipulated by the lender if he/she puts 1 in the p parameter for auctionLength, which equals to 1 second. As the base time units of Solidity is seconds
https://docs.soliditylang.org/en/v0.8.19/units-and-global-variables.html#time-units
So, the lender will only have to wait for 1 second after startAuction() and then can seize the collateral.
I have made the POC for this case:
please modify the auctionLength of the test_borrow() function in test/Lender.t.sol to 1 or 1 seconds (remove the days suffix) and paste the code snippet below to test/Lender.t.sol
Use forge test -vv --mt test_seizePoc to run this test case.
Borrowers may unintentionally ignore the auctionLength of the pool when they borrow a loan from or refinance a loan to that pool (if the auctionLength is displayed on the UI) and have their collateral seized almost immediately.
Manual
Declare a minimum auctionLength so that the loan can't be seized so fast.
Alert some warnings to warn the borrowers about short auctionLength of the pool they want to borrow.
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.