The getVaultCreditCapacity
function in VaultRouterBranch.sol fails to properly handle underwater vaults where debt exceeds assets. When calculating negative credit capacity, the conversion from signed to unsigned values in convertSd59x18ToTokenAmount
reverts, causing a complete system lockout of critical vault functions including withdrawals.
When a vault's debt exceeds its assets, credit capacity becomes negative. The system fails to handle this scenario in the following sequence:
The core issue occurs in Math.sol
:
This causes critical vault functions to become completely unusable once a vault becomes underwater, as they all depend on getVaultCreditCapacity
.
Sudden System Lockout
When debt exceeds assets, all redemptions become impossible
No partial withdrawals allowed even if assets remain
Users completely locked out of withdrawing any funds
Core Function Failure
getIndexTokenSwapRate
fails due to credit capacity revert
getVaultAssetSwapRate
fails due to credit capacity revert
redeem()
becomes completely unusable
The following test demonstrates how vault functions fail completely when underwater:
Manual Analysis, Foundry
Modify convertSd59x18ToTokenAmount
to properly handle negative values:
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.