Normal behavior:
The module secret_vault::vault
lets a user call set_secret(&signer, secret: vector<u8>)
to store a String
secret in a Vault
resource under their account and later read it via get_secret(address)
.
Specific issue:
The secret is supplied as a transaction argument and converted to a String
on-chain. On Aptos, transaction payloads (including arguments) are public and trivially viewable in block explorers and full node APIs. This means the secret is exposed even before it’s written to state, and storing it on-chain preserves the plaintext forever.
Likelihood: High
Every invocation of set_secret
necessarily includes the plaintext secret as a transaction argument; this occurs on all successful and reverted transactions alike because payloads are broadcast.
Block explorers and public RPCs routinely index and display transaction arguments, making retrieval trivial for anyone.
Impact: Severe
Immediate and irreversible disclosure of sensitive information (passwords, API keys, PII) to the public.
Regulatory/compliance exposure and downstream account compromise wherever the secret is reused.
1) Deploy the program on the dev network
2) Call the function to set the secret with your secret, here hello!
aptos move run --function-id 0xf9228a020889c982c81387041ed2c9a28b7560752798dd9738795ab00666f4a6::secret_vault::set_secret --args string:hello!
3)
Go the explorer and check the payload of the transaction
https://explorer.aptoslabs.com/txn/0x7ae7e3c42c07f0a487a7feaa56a6db5d97e8106568d2bb0938f0c42d968a0aa7/payload?network=local
You will have the secret in hex in the argument:
68656c6c6f21 ==> hello! in hexa\
Do not store secret on-chain.
If required: at least encrypt them before storing them or only commit the hash if only use for comparison
Design guidance:
Never transmit plaintext secrets in transaction arguments. Do not rely on access control to keep data private; on public chains, privacy is not provided by default.
Use client-side encryption (hybrid/public-key) and store only ciphertext, or store a one-way commitment (hash/salt/nonce) if you only need verification.
Consider eliminating on-chain storage entirely and using an off-chain secret manager, with the chain storing only references or commitments.
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.