The set_secret
function lacks proper access control, allowing anyone (not just the owner) to set vault secrets. This enables unlimited users to call set_secret
and create arbitrary Vault
entries to their own addresses, leading to unbounded and potentially polluted global storage.
The set_secret
function has no access control in which anyone allows to set the vault secret instead of being exclusive to only owner.
Likelihood:
This occurs every time any user calls set_secret
.
Impact:
Unlimited number of users can call set_secret
and write Vault
to their own addresses, polluting global storage.
Add the following test in secret_vault.move
:
In terminal run aptos move test -f test_anyone_can_call_set_secret
:
The test passed indicating that any random user can successfully set a secret to the contract's global storage Vault
by calling set_secret
function.
Implement access control in 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.
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.