The withdrawNFT function uses the same flawed logic as the borrow function, applying the liquidation threshold to debt instead of collateral. This allows users to withdraw NFTs even if the remaining collateral becomes insufficient to cover their debt, leading to undercollateralized positions.
uint256 collateralValue = 200$
uint256 nftValue = 100$
uint256 userDebt = 125$
uint256 liquidationThreshold = 8000; // 80% in basis points
What the code does
userDebt.percentMul(liquidationThreshold) = 125e18 * 8000 / 10000 = 100e18 ($100)
if (100e18 < 100e18) → false → withdrawal allowed
The inverted check allows collateral to drop below debt / threshold leavinf the debt undercollaterlized leading to loss of funds for the protocol
use the correct logic for liquidationthreshold calculation
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.