The get_secret
function should gracefully handle cases where no vault exists for the requested address, providing clear error messages or appropriate default behavior instead of crashing with cryptic technical errors.
The get_secret
function calls borrow_global<Vault>(@owner)
without first checking if the resource exists, causing uncontrolled aborts with confusing error messages when users attempt to read secrets before any vault has been created. This results in poor user experience where users receive technical error codes (MISSING_DATA
) instead of meaningful feedback about the system state.
Likelihood:
Any call to get_secret
before set_secret
triggers the error
New users will encounter this immediately when checking for existing secrets
The vulnerability affects 100% of first-time users
No mechanism exists for callers to safely check vault existence beforehand
Impact:
Poor user experience: Users receive cryptic MISSING_DATA (code 4008)
errors with technical messages like "Failed to borrow global resource"
Unpredictable behavior: Function success depends entirely on hidden state and calling order
Development friction: No way for developers to handle the "no data exists" case gracefully
Support burden: Users require assistance interpreting technical error codes
API inconsistency: Cannot distinguish between "no vault exists" and other system errors
The following test demonstrates the missing existence checks vulnerability:
Add existence check before attempting to borrow the resource:
There is no security impact on the protocol, therefore this is an Informational finding. Also, it is a user mistake, if the user calls `get_secret` without first calling `set_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.