The module is intended for the owner to store a secret, but currently any account can call set_secret
and create their own Vault resource.
There is no access control restricting secret creation to a specific owner or admin address.
Likelihood: High
This issue will occur any time a non-owner account calls set_secret
.
Impact: Low
Any account can create a Vault resource for themselves, breaking the main invariant.
Put the test_anyone_set_secret
into the test section of secret_vault.move
.
Run the test with aptos move test -f test_anyone_set_secret
.
Restrict the set_secret
function so that only the designated owner (or a whitelist/admin) can create or update the Vault resource.
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.