The owner should be able to set a secret and then update it later. But, the set_secret
function uses move_to
to create the Vault
. In Move, move_to
aborts if a resource of that type already exists at the address. This means the function works only once per address, making it impossible to update a secret.
Likelihood: High
This vulnerability is triggered whenever the owner (or any user) attempts to call set_secret
for a second time.
Secret rotation is a standard and expected practice, making a second call highly probable.
Impact: High
Denial of Service: The owner is prevented from managing their secret after the initial setup.
Security Risk: In a real-world scenario, the inability to rotate a compromised or stale secret is a significant security issue.
The vulnerability is a direct consequence of the Move language's rules for resource management.
The owner calls set_secret
for the first time. The move_to
operation succeeds.
The owner needs to update the secret and calls set_secret
again.
The move_to
instruction is executed, but the Move VM detects an existing Vault
resource at the owner's address.
The transaction immediately aborts with an ERESOURCE_ALREADY_EXISTS
error.
The following code can be a possible solution to fix this issue:
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.