According to the documentation, the SecretVault should allow an owner to store a secret and later retrieve it, while preventing others from accessing it. So the owner should be set, and the owner should be able to call get_secret()
without any reverts
The get_secret
function contains multiple critical flaws that prevent it from working as documented:
It references an undefined @owner
address instead of using the caller's address
It attempts to borrow the Vault resource from this undefined address rather than from the caller
The owner check is incorrectly implemented, making it impossible for legitimate owner to access the secret stored
Likelihood: High
This issue will occur every time an owner attempts to retrieve their secret, making the core functionality completely broken.
The code as written cannot compile due to the undefined @owner address, so the contract is non-functional from inception.
Impact: High
The primary functionality of the contract (storing and retrieving secrets) is completely broken, rendering the application useless.
Impact 2
Removes the broken owner check
Uses the caller's address (owner) to retrieve the Vault resource
Maintains the security model where users can only access their own secrets, therefore only the owner can retrieve the secret they have set
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.