This repository has been archived by the owner on Nov 19, 2023. It is now read-only.
xiaoming90 - StrategyVault can perform a full exit without repaying all secondary debt #184
Labels
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
High
A valid High severity issue
Reward
A payout will be made for this issue
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Won't Fix
The sponsor confirmed this issue will not be fixed
xiaoming90
high
StrategyVault can perform a full exit without repaying all secondary debt
Summary
StrategyVault can perform a full exit without repaying all secondary debt, leaving bad debt with the protocol.
Vulnerability Detail
Noted from the codebase's comment that:
Thus, when the StrategyVault-side performs a full exit for a vault account, Notional-side does not check that all secondary debts of that vault account are cleared (= zero) and will simply trust StrategyVault-side has already handled them properly.
Line 271 below shows that only validates the primary debt but not the secondary debt during a full exit.
https://github.com/sherlock-audit/2023-03-notional/blob/main/contracts-v2/contracts/external/actions/VaultAccountAction.sol#L271
Impact
Leveraged vaults are designed to be as isolated as possible to mitigate the risk to the Notional protocol and its users. However, the above implementation seems to break this principle. As such, if there is a vulnerability in the leverage vault that allows someone to exploit this issue and bypass the repayment of the secondary debt, the protocol will be left with a bad debt which affects the insolvency of the protocol.
Code Snippet
https://github.com/sherlock-audit/2023-03-notional/blob/main/contracts-v2/contracts/external/actions/VaultAccountAction.sol#L271
Tool used
Manual Review
Recommendation
Consider checking that all secondary debts of a vault account are cleared before executing a full exit.
The text was updated successfully, but these errors were encountered: