The intended behavior is that only the contract owner (@owner
) should be able to access their stored secret in the Vault
.
The issue is that the function get_secret
accepts an arbitrary address
parameter and only checks whether it matches the hardcoded @owner
. Since the owner address is publicly defined in Move.toml
, anyone can supply this value and retrieve the secret. This makes the access control ineffective.
Likelihood: High
The owner address is publicly visible in Move.toml
and therefore easy to guess or obtain.
Any external caller can bypass the access control by passing caller = @owner
.
Impact: High
Confidential data stored in the Vault
is leaked to unauthorized users.
This compromises both confidentiality and trust in the contract, as secrets intended for the owner are fully exposed.
Add this Proof of concept to the secret_vault.move
and run aptos move test
.
The attacker successfully retrieves the owner’s secret by supplying the known hardcoded address.
The recommended mitigation changes the function to accept a &signer
reference instead of a raw address. This allows the function to dynamically obtain the caller’s actual address at runtime using signer::address_of(caller)
. By asserting against this runtime address and borrowing the resource for that specific signer, the contract enforces proper access control and ensures that only the true owner can read their secret.
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.