The get_secret function is intended to retrieve a stored secret by verifying the provided caller address against @owner and borrowing the Vault resource from that address, ensuring only the owner accesses their data. It complements set_secret, which stores the Vault under the caller's address, relying on Move's global storage for ownership enforcement.
The function hardcodes the borrow_global to @owner instead of using the caller parameter or signer's address, creating a mismatch where it only retrieves from the deployer's fixed address, not dynamically from where set_secret stores it. This renders secrets stored under other addresses inaccessible, while potentially exposing the deployer's secret, violating ownership invariants and the contract's single-owner intent.
Likelihood:
Deployers or users store secrets under addresses other than @owner via set_secret, but get_secret fails to retrieve them due to the hardcoded borrow.
The fixed @owner (from Move.toml or deployment) remains constant and discoverable, enabling targeted exploits when combined with the function's public access.
Impact:
Secrets stored under non-@owner addresses become irretrievable via get_secret, as it always borrows from the fixed @owner, leading to access failures and data loss for users.
If a secret is stored under @owner (e.g., by the deployer), it gets exposed to unauthorized callers due to the parameter bypass, amplifying privacy breaches.
This POC shows the mismatch: a secret is stored under a non-@owner address, but get_secret fails to retrieve it because it hardcodes to @owner. The test asserts that direct borrowing works (proving storage), but get_secret returns nothing or aborts, highlighting the flaw.
Dynamically borrow from the caller's address (after verifying it) instead of hardcoding @owner. Combine with signer checks for security (as in earlier mitigations).
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.