Secret Vault on Aptos

First Flight #46
Beginner FriendlyWallet
100 EXP
View results
Submission Details
Severity: high
Valid

Malicious user can retrieve the secret

Root + Impact

get_secret` does not sufficiently validate the caller is a signer

Description

get_secret can be called by anyone because it does not ensure that the caller signs the transaction

@> public fun get_secret (caller: address):String acquires Vault{
assert! (caller == @owner,NOT_OWNER);

Risk

Likelihood:

High: Anyone can call this

Impact:

High: Exposed keys

Recommended Mitigation

Modify the get_secret to check if it's a signer

- public fun get_secret (caller: address):String acquires Vault{
- assert! (caller == @owner,NOT_OWNER);
+ public fun get_secret (caller: &signer):String acquires Vault{
+ assert! (signer::address_of(caller) == @owner,NOT_OWNER);
Updates

Lead Judging Commences

bube Lead Judge 17 days ago
Submission Judgement Published
Validated
Assigned finding tags:

Lack of signer check in `get_secret`

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.