Secret Vault on Aptos

First Flight #46
Beginner FriendlyWallet
100 EXP
View results
Submission Details
Severity: low
Valid

Will abort if Vault already exists for caller, consider a replace pattern

Will abort if Vault already exists for caller, consider a replace pattern

Description

  • In set_secret function if vault exists for the caller, the function will abort without any custom message or error or event.

public entry fun set_secret(caller:&signer,secret:vector<u8>){
let secret_vault = Vault{secret: string::utf8(secret)};
@> move_to(caller,secret_vault);
event::emit(SetNewSecret {});
}

Risk

Likelihood: medium

  • Any user trying to create the vault and if vault already exists, the set_secret function will abort without any custom message or error or event emission

Impact: medium

Recommended Mitigation

  • Add custom error message or event emission for the set_secret function indicating the vault already exists.

Updates

Lead Judging Commences

bube Lead Judge 18 days ago
Submission Judgement Published
Validated
Assigned finding tags:

The `secret` can not be updated

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.