The borrow function allows users to borrow reserve assets using their NFT collateral. However, some state-updating functions are executed after the external call to transferAsset, which can lead to incorrect debt and inconsistencies calculations in the protocol.
The following operations are performed aftertransferAsset leading to incorrect calculations and reentrancy attacks.
These updates should be done before the external call to ensure proper execution flow.
Incorrect Debt Tracking, Users might borrow more than their collateral allows because debt updates happen after the actual borrowing succeeds.
The user’s total debt is calculated after the asset is transferred, which may result in an incorrect liquidation assessment
Borrowers might be able to borrow more than they should.
Liquidity pool imbalances could occur due to incorrect _ensureLiquidity(amount) checks.
Manual review
To fix this issue, state updates should be performed before the external transfer call (transferAsset) succeeds.
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.