Secret Vault on Aptos

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

One Time Set of secret No Update Path

Description

The owner should be able to update the secret.
Using move_to will abort if a Vault already exists, there’s no move_from/replace logic, so the secret becomes immutable after first set.

// move
@> move_to(caller, secret_vault); // aborts if Vault already exists at address

Risk

Likelihood:

Triggers on the second attempt to set the secret.

Impact:

Owner cannot rotate/update secrets, poor UX and potential security risk.

Proof of Concept

// move
set_secret(owner, b"first"); // ok
set_secret(owner, b"second"); // aborts: resource exists

Recommended Mitigation

Consider Making this changes

- move_to(caller, secret_vault);
+ if (exists<Vault>(@owner)) {
+ let _old = move_from<Vault>(@owner);
+ // (drop _old)
+ }
+ move_to(caller, secret_vault);
Updates

Lead Judging Commences

bube Lead Judge 16 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.