The SecretVault
Move smart contract is intended to allow users to securely store and retrieve private secrets.
However, our analysis revealed multiple security flaws that compromise confidentiality and proper access control.
These issues allow unauthorized access, overwrite stored data, and reduce auditability.
The get_secret
function is intended to allow only the owner of a vault to retrieve their secret.
However, the function accepts an arbitrary address
argument and compares it against a hardcoded @owner
.
This means that anyone who knows the owner’s address can retrieve the secret, since the check is not tied to the transaction signer.
Likelihood: High
Anyone can call this function from any account.
The only requirement is knowing the target address (@owner
), which is public on-chain.
Impact: High
Secrets expected to be private become publicly accessible.
This completely defeats the purpose of the SecretVault
contract.
Tie access control to the transaction signer, not a free address
argument:
The set_secret
function creates a new Vault
every time and stores it with move_to
.
This overwrites any existing secret for the user. The design does not support multiple secrets or prevent accidental overwrites.
Likelihood: Medium
Every new call from the same user overwrites the previous secret.
Impact: Medium
Loss of previously stored secrets.
Users may believe multiple secrets are supported, leading to accidental data loss.
Implement update logic instead of overwriting blindly:
@owner
The get_secret
function references a hardcoded @owner
address.
This is not defined in the contract and breaks the intended access control mechanism.
It also makes the module non-portable and confusing to audit.
Likelihood: High
The hardcoded reference is invalid if @owner
is not properly defined.
Developers may incorrectly assume it refers to the caller.
Impact: Medium
Unexpected runtime errors.
Non-portable contract design.
Replace with dynamic address resolution using the caller signer:
The SetNewSecret
event is emitted without including any metadata.
Events should carry information to make them meaningful for auditors and dApp frontends.
Likelihood: Medium
Events are always emitted but contain no useful information.
Impact: Low
Reduced auditability and dApp integration.
Makes it harder to track which account updated their secret.
Include useful fields in the event:
The current SecretVault
contract has critical design issues that break confidentiality guarantees.
By fixing access control, preventing overwrites, removing hardcoded @owner
, and improving events, the contract can achieve its intended purpose of secure secret storage.
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.