You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 3, 2024. It is now read-only.
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
M - Vault doesn't get removed from _vaultsByType, thus it can never be added again
Summary
The removeVault function inside LMPVaultRegistry is encharged of removing a given vault address from the different lists and mappings. The other function from the pair is addVault, which in turn adds a given vault as long as it is not already there in the lists. There is an issue in removeFunction which makes it impossible for a removed vault to be added again.
Vulnerability Detail
Function removeVault forgets to remove the vault address from the set _vaultsByType[vaultType]. Therefore, if one tries to add a previously removed vault back to the registry, it will fail in the following code inside addVault:
if (!_vaultsByType[vaultType].add(vaultAddress)) revert VaultAlreadyExists(vaultAddress);
Impact
Vaults that were previously removed can never again be added to the registry.
Tool used
Manual Review
Recommendation
Add the vault address removal from the _vaultsByType[vaultType] set.
sherlock-admin
changed the title
Zealous Marmalade Cobra - M - Vault doesn't get removed from _vaultsByType, thus it can never be added again
0x70C9 - M - Vault doesn't get removed from _vaultsByType, thus it can never be added again
Oct 3, 2023
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
0x70C9
false
M - Vault doesn't get removed from _vaultsByType, thus it can never be added again
Summary
The
removeVault
function insideLMPVaultRegistry
is encharged of removing a given vault address from the different lists and mappings. The other function from the pair isaddVault
, which in turn adds a given vault as long as it is not already there in the lists. There is an issue inremoveFunction
which makes it impossible for a removed vault to be added again.Vulnerability Detail
Function
removeVault
forgets to remove the vault address from the set_vaultsByType[vaultType]
. Therefore, if one tries to add a previously removed vault back to the registry, it will fail in the following code insideaddVault
:Impact
Vaults that were previously removed can never again be added to the registry.
Tool used
Manual Review
Recommendation
Add the vault address removal from the
_vaultsByType[vaultType]
set.Duplicate of #674
The text was updated successfully, but these errors were encountered: