The set_secret function in the smart contract is designed so that only a specific owner account can save a new secret in the vault. However, in the present code, there is no verification of the caller's identity. This means that any account can trigger set_secret, generating a personal Vault and storing it at their own address on chain.
Unrestricted Access:
Anyone can call set_secret and save their own secret, rather than this being limited to a predetermined owner.
Loss of Central Control:
Instead of one trusted authority maintaining the secret, the contract now allows numerous vaults to be created, undermining the original intent and introducing unpredictability into the system's security assumptions.
Any external account can directly call set_secret without restriction.
No validation exists on signer::address_of(caller), making exploitation trivial and guaranteed.
Breaks the "single owner" design, multiple users can create their own vaults.
Reduces trust assumptions: the contract no longer enforces central ownership.
Suggested Fix
Add a check at the start of set_secret to ensure only the owner’s account can perform this action:
assert!(signer::address_of(caller) == @owner, NOT_OWNER);
With this change, only transactions signed by the owner are allowed to create or update the Vault, ensuring exclusive control as originally intended. All unauthorized attempts will now fail.
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.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.