Secret Vault on Aptos

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

on-chain storage is publicly readable, never store the secrets on-chain

on-chain storage is publicly readable, never store the secrets on-chain

Description

  • set_secret function stores secret directly on-chain which is publicly visible to anyone on the public mempool.

public entry fun set_secret(caller:&signer,secret:vector<u8>){
@> let secret_vault = Vault{secret: string::utf8(secret)};
move_to(caller,secret_vault);
event::emit(SetNewSecret {});
}

Risk

Likelihood: high

  • Any user setting the secret for vault is publicly visible to anyone on the public mempool

Impact: high

  • Vault containing funds can be drained out by the attacker using public mempool to exploit the vault


Recommended Mitigation

  • Use secure way of storing the secrets to prevent the exploit for draining the funds

Updates

Lead Judging Commences

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

Anyone can see the `secret` on chain

Support

FAQs

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