#46843 [SC-Critical] Bypass of Restrictions When Paraclear_transfer_registry Is Unregistered
Description
Brief/Intro
Vulnerability Details
fn _detect_transfer_restriction(
self: @ComponentState<TContractState>,
sender: ContractAddress,
recipient: ContractAddress,
token_address: ContractAddress,
amount: u256,
) {
// Check if token is supported
assert!(self.is_asset_supported(token_address), "Transfer: Token address is invalid");
// Read transfer registry address
let transfer_registry_address = self.Paraclear_transfer_registry.read();
// If transfer registry is set, check restrictions
if transfer_registry_address.is_non_zero() {
let registry_dispatcher = IRegistryDispatcher {
contract_address: transfer_registry_address,
};
let is_transfer_restricted: u8 = registry_dispatcher
.detect_transfer_restriction(sender, recipient, amount);
assert!(is_transfer_restricted == 0, "Transfer: Transfer is not allowed");
}
// No 'else' block for when transfer_registry_address is zero.
}Impact Details
Proof of Concept
Proof of Concept
Previous#46839 [SC-Low] `max_withdraw` and `max_withdraw` do not fully consider global restrictions.Next#46856 [SC-Medium] The calculation of shares obtained through token trades will be incorrect, causing users to pay excessive yield fees.
Was this helpful?