Insufficient check can lead to removal of undercollateralised assets by vault owner.
In SmartVaultV3 contract inside removeAsset() function check for canRemoveCollateral() is only performed if (token.addr == _tokenAddr).
As implementation of getTokenManager().getTokenIfExists() not available but suppose there are 2 types of tokens in assets tokenA, tokenB.
First removeAsset is called by owner with _tokenaddressB.
If on next line getTokenManager().getTokenIfExists(_tokenAddressB) gives tokenA.
on next line (tokenA.addr != _tokenAddressB) but tokenB exist.
as if(false) so inside if statement not check for canRemoveCollateral() and next line send token B
Undercollaterised assets can be removed
Manual
apply check
require(token.addr == _tokenAddr,"Address not Same");
require(canRemoveCollateral(token, _amount), UNDER_COLL);
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.