The initiateSwap function in StabilityBranch.sol lacks proper validation of vault status before accepting user's USD tokens. When users attempt to swap tokens using a paused vault ID, their tokens get transferred and locked in the contract while the subsequent fulfillSwap operation by the keeper will revert due to vault.live() checks.
From the Vault.sol code, we can see there are three different loading functions:
load(): Basic loading without checks
loadExisting(): Checks if vault exists
loadLive(): Checks if vault exists AND is active
The initiateSwap function uses Vault.load() which doesn't validate whether the vault is live or not:
StabilityBranch.sol#L241
When a vault gets paused by protocol administrators, users can still call initiateSwap for this paused vault.
More importantly when keeper calls fulfillSwap, it will revert bcoz it checks the vault is paused or not :
StabilityBranch.sol#L360
Example Scenario:
A vault gets paused by protocol administrators
Users can still call initiateSwap for this paused vault
Their tokens get transferred to the contract
The keeper's fulfillSwap operation will inevitably fail due to Vault.loadLive() check
Users tokens can get temporarily locked in the contract if the vault is paused.
Manual review
Replace Vault.load(vaultIds[i]) with Vault.loadLive(vaultIds[i]) in the initiateSwap function to enforce vault status validation at the entry point. This would prevent users from initiating swaps with paused vaults:
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.