57838 sc insight missing produce name sanitization allows breaking snip 12 standard compliance
Description
Brief/Intro
Vulnerability Details
fn _produce(
ref self: ContractState, instance_info: InstanceInfo,
) -> (ContractAddress, ContractAddress) {
let info = instance_info.clone();
assert(info.name.len().is_non_zero(), super::Errors::EMPTY_NAME);
assert(info.symbol.len().is_non_zero(), super::Errors::EMPTY_SYMBOL);
let metadata_name_hash: felt252 = info.name.hash();
let metadata_symbol_hash: felt252 = info.symbol.hash();
let contract_uri_hash: felt252 = info.contract_uri.hash();
assert(
self
.nft_info
.entry((metadata_name_hash, metadata_symbol_hash))
.nft_address
.read()
.is_zero(),
super::Errors::NFT_EXISTS,
);
let message = ProduceHash {
name_hash: metadata_name_hash,
symbol_hash: metadata_symbol_hash,
contract_uri: contract_uri_hash,
royalty_fraction: info.royalty_fraction,
};
let hash = message.get_message_hash(get_contract_address());
let is_valid_signature_felt = ISRC6Dispatcher {
contract_address: self.factory_parameters.signer.read(),
}Impact Details
References
Proof of Concept
Previous57910 sc insight missing validation on referral percentage sumNext57776 sc insight staking sol is not eip4626 compliant breaking integrations
Was this helpful?