main: ensure seed is present before completing OTP registration
What changed, and why it matters
This commit fixes a bug in the Blockstream Jade hardware wallet's one-time-password (OTP) registration feature. Previously, if no wallet seed existed, the device would log an error and show a reset message, but then accidentally continue with OTP registration anyway. Now it stops and cleans up properly. The direct security impact is moderate: continuing without a seed could have led to storing an OTP secret that the device could not properly protect or later use, but the commit itself does not show an attacker-controlled path to exploit this.
Review whether any OTP secrets persisted during prior seed-absence fall-through states need invalidation or re-initialization, and audit other process functions for similar missing error-path termination after reject/await_error calls.
Security signals we found
Missing error-path termination (fall-through after error reporting)
State validation bypass possible before fix
OTP secret persistence after seed-absence error
Evidence from the diff
In main/process/register_otp.c, after detecting that no wallet seed is available, the code called jade_process_reject_message() and await_error() but fell through to the rest of the function. The patch adds ‘goto cleanup;’ so the process exits after reporting the error. This prevents the subsequent ‘Validate and persist the new otp uri’ code from running in a state the developer considered invalid. The change is a single control-flow fix with no other logic alterations.
Changed components
main/process/register_otp.cOTP registration process on Blockstream JadeInspect captured patch +1 / −0
diff --git a/main/process/register_otp.c b/main/process/register_otp.c
index c3ee0c6..d86b4eb 100644
--- a/main/process/register_otp.c
+++ b/main/process/register_otp.c
@@ -128,6 +128,7 @@ void register_otp_process(void* process_ptr)
JADE_LOGE("No wallet seed available. Wallet must be re-initialised from mnemonic.");
jade_process_reject_message(process, CBOR_RPC_INTERNAL_ERROR, "Feature requires resetting Jade");
await_error("Feature requires Jade reset");
+ goto cleanup;
}
// Validate and persist the new otp uri
Why this scored 59/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.