A critical vulnerability has been identified in the LendingPool contract's collateral withdrawal mechanism that allows attackers to undercollateralize positions through price manipulation. The vulnerability stems from inadequate price volatility protection during NFT withdrawals, enabling attackers to exploit market price movements to drain protocol funds.
The vulnerability exists in the withdrawNFT
function where the contract fails to properly account for NFT price volatility during withdrawal operations. The current implementation only checks the NFT price at withdrawal time without considering potential price movements:
Inadequate Price Protection - Single-point price check during withdrawal
No protection against flash crashes
Insufficient State Validation - Missing comprehensive collateral coverage checks
No protection against rapid price movements
Inadequate consideration of market volatility
The vulnerability could lead to:
Protocol insolvency through undercollateralized positions
Loss of user funds
System instability
Static Analysis - Slither for vulnerability detection
Solhint for code quality assessment
TypeChain for type safety verification
Dynamic Testing - Hardhat for test environment setup
Waffle for test framework
Ethers.js for Tx simulation
test implementation using Hardhat that demonstrates the vulnerability:
After running, this test produces the following output:
Immediate Fixes - Implement price volatility checks
Add minimum time locks between price checks and withdrawals
Implement multiple price oracle checks
Add flash crash protection mechanisms
Long-term Improvements - Implement dynamic LTV adjustments based on volatility
Add circuit breakers for rapid price movements
My test output confirms the vulnerability by demonstrating how an attacker can manipulate the system to create undercollateralized positions. The successful test execution shows that the current implementation allows withdrawals even when they would leave the position undercollateralized, posing a significant risk to the protocol's solvency.
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.