Missing Access Control in set_secret
Function which creates Critical Impact
The normal behavior should require that only the designated owner can store secrets in their vault, ensuring exclusive control over sensitive data.
The current implementation allows any user to call set_secret
and create a vault under their own account, completely bypassing the intended owner-only access control mechanism.
Likelihood:
Any user can call this function since it's a public entry function with no access control checks
Attackers can immediately exploit this by calling the function with any signer account
Impact:
Complete bypass of the owner-only security model, allowing unauthorized secret storage
Potential for attackers to create confusing vault states across multiple accounts
Violation of the core security requirement that only the owner should manage secrets
Explanation: This test demonstrates that any user (represented by attacker
with address @0x999
) can successfully call set_secret
and create their own vault. The test passes, proving the vulnerability exists. In a secure implementation, this call should fail with an access control error since the attacker is not the designated owner.
Explanation: The mitigation adds proper access control by defining a constant OWNER_ADDRESS
and checking that only this address can call the function. The assert!
statement will abort execution with error code E_NOT_OWNER
if any unauthorized user attempts to set a secret, preventing the security bypass.
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.