<!-- canonical: https://0xsimao.com/findings/spectra-metavault-mistake-unregister-index-functions -->

# Possible mistake in the unregister by index functions

Low/Info · Sherlock · Yield-tokenisation vaults · 16th December 2025

Finding L-2 of the Spectra MetaVault Bridge security review.

- Protocol: https://www.spectra.finance/
- Report: /reports/spectra-metavault-bridge
- Source: https://github.com/0xsimao/audits/blob/main/Sherlock/private-audits/2025-12-16-spectra-metavault.pdf

---

## Summary

`MetavaultsRegistry::unregisterMarketByIndex()` don't check that the index matches the expected market, which may lead to issues if called twice in a row.

## Vulnerability Detail

As `MetavaultsRegistry::unregisterMarketByIndex()` doesn't check the market, if 2 calls are made consecutively, they may arrive at the blockchain in different order, and remove the wrong markets (array popping changes order).

## Impact

## Code Snippet

https://github.com/sherlock-audit/2025-12-spectra-metavault-update-dec-16th/pull/2/files#diff-d6dbd850708b46c46f64d8bc2d13e4fe2de6f7ac75f0981bf638274c7830a293R187

## Tool Used

Manual Review

## Recommendation

Send the expected market as argument to verify.

Disclosed by 0xSimao (https://0xsimao.com/).
