Skip to content
This repository has been archived by the owner on Mar 3, 2024. It is now read-only.

dipp - Cannot add vault if it has been removed previously from the LMPVaultRegistry #795

Closed
sherlock-admin2 opened this issue Aug 30, 2023 · 0 comments
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Medium A valid Medium severity issue Reward A payout will be made for this issue

Comments

@sherlock-admin2
Copy link
Contributor

sherlock-admin2 commented Aug 30, 2023

dipp

high

Cannot add vault if it has been removed previously from the LMPVaultRegistry

Summary

Vaults are not removed from the vaultsByType set when they are rmoved from the LMPVault registry preventing them from being added to the registry again.

Vulnerability Detail

A vault cannot be added to the registry if it has been removed before due to the check in the addVault function that reverts if the vaultAddress is in the vaultByType becuase the vault address is not removed from vaultByType in removeVault.

The onlyLMP modifier of DestinationVault uses the LMPVaultRegistry to check if an LMPVault is registered. Removing the vault from the registry prevents priveleged interation with the destination vault's functions withdrawUnderlying and depositUnderlying. These functions are used when rebalancing the vault. Not being able to call these functions would result in not being able to rebalance the LMPVault through the rebalance functionality.

Impact

LMPVaults that were once removed but should be added are not able to rebalance.

Code Snippet

LMPVaultRegistry.sol#L64-L82

LMPVaultRegistry.sol#L59

DestinationVault.sol#L59-L64

DestinationVault.sol#L204-L232

LMPDebt.sol#L321-L338

LMPDebt.sol#L390

Tool used

Manual Review

Recommendation

Remove the vault from the vaultsByType set.

Duplicate of #674

@github-actions github-actions bot added Medium A valid Medium severity issue Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label labels Sep 11, 2023
@sherlock-admin sherlock-admin changed the title Flat Marigold Snake - Cannot add vault if it has been removed previously from the LMPVaultRegistry dipp - Cannot add vault if it has been removed previously from the LMPVaultRegistry Oct 3, 2023
@sherlock-admin sherlock-admin added the Reward A payout will be made for this issue label Oct 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Medium A valid Medium severity issue Reward A payout will be made for this issue
Projects
None yet
Development

No branches or pull requests

2 participants