As there is no minimum value for the auction length and the only check about the auction length is that it is unequal zero, it is possible to create pools with auction length one. This enables the possibility to create pools that act like a trap, which will steal the collateral 12 seconds after depositing it. This vulnerability can be increased further by front running the borrow call of a user and changing the auction length of the pool to one right before the user takes a loan from it.
The attack path works as followed:
Malicious user creates a pool with auction length 1
A user makes the mistake to borrow a loan from the pool
Malicious user starts an auction right after it
Malicious user waits for one block to be validated (12 seconds)
Malicious user calls the seizeLoan function and receives the collateral of the user
The following POC code shows the attack path, it can be implemented inside the current test folder of the repo.
Borrowers lose their collateral.
Manual Review, Foundry, VSCode
Instead of checking if the auction length is not zero, check if it is bigger than a auction length minimum constant.
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.