Pool details can be changed without changing poolID. When borrower calls borrow(poolID), the transaction can be frontrun by changing the loan detials, eg. chaning the auction length from 1 day to 1 second and intrest rate from 10% to 999%.
When Borrow is called a struct is entered as a parameter which contains poolID
, loan
and collateral
. The lender can front run a valid borrow transaction and insert at transaction in the same block which keeps the same poolID
but changes the auctionLength
and interestRate variables
.
Here is a POC where the lender creates a pool p
.
The borrow creates a struct containing the poolId generated by p:
bytes32 poolId = lender.setPool(p);
The lender frontRuns the Borrow by creating another pool q
. Now the hash of the pool details is calculated by the keccak hash of certain aspects of the pool:
but none of these properties are the interest rate and auction rate, which are what we manipulate. Therefore the poolId is the same. In fact the poolId stays the same as long as the Loan Token and Collateral Token are unchanged.
The borrow transaction does not revert and then the borrower gets a loan with far worse conditions than they initially signed up for.
This function/POC should be copy pasted to the already existing Lender.t.sol in the test file of the 20203-07-BEEDLE folder.
This also verifies that the auction time was succesfully reset by
starting the auction - lender.startAuction(loanIds);
setting block timestamp forward 2 seconds vm.warp(block.timestamp + 2);
and seizing the borrower-victim's loan lender.seizeLoan(loanIds);
Loaners can change the conditions of loans as soon as borrowers submit a borrow()
transaction without causing it to revert. This can
-allow them to set the refinancing/auction period to 1 second which almost instantly can liquidate the borrower
-set the interest to 999%
Foundry
The keccak hash should ensure that it is unique when critical aspects of the loan are different.
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.