#46839 [SC-Low] `max_withdraw` and `max_withdraw` do not fully consider global restrictions.
Description
Brief/Intro
Vulnerability Details
fn max_deposit(self: @ContractState, receiver: ContractAddress) -> u256 {
let status = self.status.read();
if (status == VaultStatus::Closed) {
return 0;
}
if (!self._is_vault_healthy()) {
return 0;
}
let tvl_limit = self.tvl_limit.read();
if (tvl_limit == 0) {
return Bounded::<u256>::MAX;
}
let current_assets = self._total_assets();
if (current_assets >= tvl_limit.into()) {
return 0;
}
tvl_limit.into() - current_assets
}Impact Details
References
Proof of Concept
Proof of Concept
Previous#46747 [SC-Insight] Self-Referral Vulnerability in Account Referral SystemNext#46843 [SC-Critical] Bypass of Restrictions When Paraclear_transfer_registry Is Unregistered
Was this helpful?