Storage variables on blockchain networks are inherently public and accessible to all network participants, rendering any variable designated as "secret" effectively non-confidential. So when an owner sets a secret then anyone can access the storage and get the secret by querying for example the storage per transaction hash.
High
Likelihood: High
Reason: Any user that knows how to read the storage of the chain, they can access the secret.
Impact: High
Reason: Severe disruption of protocol functionality since the secret that should be accessible only by the owner is actually accessible by anyone.
The below test case shows that anyone can read the secret
directly from the blockchain.
Start a local Aptos node in a separate terminal
Initialize an account
Returns
In the Move.toml
file replace the secret_vault
entry under [dev-addresses]
with the address found in account
(from .aptos/config.yaml
). It is the same address created in previous step.
Deploy in --dev
it should return similar information as below:
Submit a transaction to set a secret
it returns a transaction hash
Get transaction by hash
Note: Referred to the documentation provided by the local running node, http://127.0.0.1:8080/v1/spec#/operations/get_transaction_by_hash
, to see the syntax of this request.
Among other info, it returns the hex value we set as the secret, 68656c6c6f
, which proves that anyone can access the secret with a get request
The overall architecture of the module should be rethought. One could encrypt the secret off-chain, and then store the encrypted secret on-chain. This would require the user to remember a password off-chain to decrypt the 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.