The set_secret function is designed as a public entry point for storing a secret in a Vault resource under the caller's account via move_to, emitting a SetNewSecret event. It relies on Move's signer authentication to ensure the resource is stored under the correct address, intending to support secure, owner-controlled storage as per the contract's role of limiting access to the owner.
The function lacks any access control checks (e.g., asserting the caller's address matches @owner), making it callable by any account with a signer, allowing unauthorized users to create their own Vaults and use the contract for unintended purposes. This violates the README's "only the owner" restriction, potentially leading to contract misuse, resource proliferation, or conflicts with the single-owner model, while exposing the contract to spam without mitigation.
Likelihood:
Any account with a signer invokes the public entry function set_secret to create a Vault under their address, as there are no ownership checks.
Deployment on public networks like Aptos testnet exposes the function to all users, enabling exploitation without barriers or costs beyond transaction fees.
Impact:
Arbitrary users create unintended Vault resources under their accounts, diluting the contract's purpose as a single-owner secure storage and potentially leading to resource bloat or misuse on-chain.
Malicious actors flood the contract with spurious calls, consuming storage and gas without restrictions, indirectly affecting the owner's usage or network performance.
This POC demonstrates that any unauthorized user can call set_secret to create a Vault under their own address, succeeding without restrictions. The test sets a secret for both the owner and an attacker, asserting that both resources exist afterward, proving the lack of ownership enforcement.
Add an ownership check in set_secret to restrict calls to @owner only.
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.