zlsecure3 / review_star

0 stars 0 forks source link

There is no guarantee that domain shortest length is less than or equal to the longest length. #25

Open zlsecure3 opened 1 year ago

zlsecure3 commented 1 year ago

subject

There is no guarantee that domain shortest length is less than or equal to the longest length.

description

Domain shortest and longest length are set by StarNameService::set_domain_shortest_length and StarNameService::set_domain_longest_length seperately. There is no guarantee that shortest_length <= longest_length however.

The impact is that If admin set the shortest_length > longest_length accidently, StarNameService::create_name_script and StarNameService::airdrop_mint will abort due to:

let name_length = string::length(&name);
assert!(name_length >= shortest_length, ILEGAL_NAME_LENGTH);
assert!(name_length <= longest_length,ILEGAL_NAME_LENGTH);

recommendation

combine set_domain_shortest_length and set_domain_longest_length into one function, and makes sure shortest_length is less than or equal to longest_length.

locations

severity

Medium

damage

exploitability

category

Logical


system_generated: auditor:jayphbee submission_id:1465148838

zlsecure3 commented 1 year ago

grading (edit)


submission_id:1465148838


review_type:GRADING


result: TBD-yes,no


rating: TBD-123


comment: TBD-Rejected,Accepted by Secure3.


severity: TBD-Critical,Medium,Low,Informational


category:


description:


zlsecure3 commented 1 year ago

client feedback (manual copy)


submission_id:1465148838


review_type:CLIENT_FEEDBACK


result: TBD-yes,no


severity: TBD-Critical,Medium,Low,Informational


comment:


zlsecure3 commented 1 year ago

client feedback decision(edit)


submission_id:1465148838


review_type:CLIENT_FEEDBACK_DECISION


result: TBD-yes,no,yes-honored,no-honored


severity: TBD-Critical,Medium,Low,Informational


comment: