The set_secret()
function uses move_to
to publish a new Vault resource under the caller’s account every time it is invoked
In Move, move_to
aborts if the resource already exists at that address, which means:
The first call works, storing the initial secret.
Any subsequent call by the same account aborts, because Vault already exists
Likelihood: High
Any real user will eventually need to update or change the stored secret. The bug is guaranteed to manifest on the second use.
Impact: Medium
Permanent denial of service on secret rotation.
Breaks usability and may lock users into an outdated or incorrect secret forever.
Add the following test, then run the command: aptos move test -f test_move_to_twice_aborts
Replace unconditional move_to
with a create-or-update pattern, this allows the first write to succeed and subsequent calls to safely update 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.