The Vault::updateVaultSwapStrategy function uses load(vaultId) without verifying vault existence, allowing swap strategy settings to be written to uninitialized storage slots. While this doesn't affect existing vaults, it creates "ghost" settings that persist if a vault is later created at that slot.
The function writes directly to storage slots without verifying if the vault exists (i.e., has been properly initialized with non-zero id).
POC:
Inside of VaultHarness.sol
add the following selector to vaultHarnessSelectors
-
vaultHarnessSelectors[18] = VaultHarness.workaround_getVaultSwapStrategyIds.selector;
The function we are adding -
Paste this Test in rebalanceVaultsAssets.t.sol
Can write swap strategy settings to uninitialized storage slots and the settings will persist even on newly created vaults with that ID until you call Vault::updateVaultSwapStrategy
.
Foundry
Replace load()
with loadExisting()
to enforce vault existence check:
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.