Secret Vault on Aptos

First Flight #46
Beginner FriendlyWallet
100 EXP
View results
Submission Details
Impact: low
Likelihood: high
Invalid

Missing Access Control in set_secret Allows Unauthorized Calls

Root + Impact

Description

Under the project’s README, only the Owner is allowed to set and retrieve their secret:

“Owner – Only the owner may set and retrieve their secret.”

However, the on-chain implementation of set_secret lacks any access control. Any signer can call the function, which writes a Vault resource under the caller’s account and emits a SetNewSecret event—creating on-chain noise that appears indistinguishable from an owner action.

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 {});
}

This behavior diverges from the documented security model (“Owner-only”) and enables anyone to produce events that look like authoritative secret updates, potentially confusing users, monitoring, and analytics.

Risk

Likelihood: High

  • Any externally signed transaction that invokes set_secret will succeed because the function is public entry and performs no authorization checks.

Impact: Low

  • The unauthorized call does not overwrite the owner’s secret; it only writes a Vault under the caller’s own account. Core confidentiality/integrity of the owner’s data is not directly compromised.

  • The practical impact is event/log pollution and user confusion (e.g., UIs, explorers, or alerting that rely on SetNewSecret may imply the owner updated their secret when they did not).

Recommended Mitigation

Enforce owner-only access and keep the storage target consistent with the documented model. A simple guard using the owner’s address (e.g., a module constant) ensures only the owner’s signer can call this function.

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

Lead Judging Commences

bube Lead Judge 16 days ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
Assigned finding tags:

Anyone can call `set_secret` function

In Move for Aptos, the term "owner" refers to a signer, which is a verified account that owns a given resource, has permission to add resources and the ability to grant access or modify digital assets. Following this logic in this contest, the owner is the account that owns `Vault`. This means that anyone has right to call `set_secret` and then to own the `Vault` and to retrieve the secret from the `Vault` in `get_secret` function. Therefore, this group is invalid, because the expected behavior is anyone to call the `set_secret` function.

Support

FAQs

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