The get_secret
function is intended to allow the vault owner to view the stored secret associated with their account. Under secure design, the caller of the transaction (transaction sender) should be verified before granting access to sensitive information.
Instead of checking that the transaction signer matches the vault owner, the function accepts an arbitrary caller: address
parameter and compares it to the constant @owner
. This means that any user can pass another user’s address (including the actual vault owner’s address) and retrieve their secret if the vault resource exists under that address. This bypasses signer authentication entirely and allows reading secrets without authorization.
Likelihood:
Any user with network access can craft a view call to get_secret
with the vault owner’s address as the caller
argument.
The issue is reachable with no preconditions beyond knowing a valid vault address.
Impact:
Secrets belonging to any vault owner can be disclosed without permission.
Breaks core confidentiality guarantees of the vault, undermining its entire purpose.
Add the following test to the secret_vault.move
module.
It simulates an attacker supplying the owner’s address without having the owner signer.
The test should revert but it passed successfully, indicating the vulnerability.
Result:
I would recommend removing the arbitrary caller
parameter and deriving the address from the actual transaction signer using signer
.
Note that the blockchain runtime automatically provides the signer of the transaction, so now no user can call get_secret
and pass arbitrary data.
This ensures the requestor can only access their own vault data and prevents unauthorized secret disclosure.
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.