What changed, and why it matters
This commit changes how Cardano public keys are derived for SLIP39 wallets. It switches from a mutable, zeroed-out copy of the wallet seed to a non-mutable, non-zeroed copy. The change removes a safety feature that normally wipes the seed from memory after use, which could leave sensitive seed material in memory longer than intended. However, the commit message only says 'fix ada slip39 address' and gives no security explanation, so the exact risk is unclear from the diff alone.
Treat this as a security-relevant change requiring review. Verify whether the entropy buffer is zeroized by the caller or allocator after the function returns, and confirm that removing zeroize() does not leave seed material in process memory. If no equivalent cleanup exists, restore zeroization on a copy of the entropy rather than on the original buffer, or ensure the memory region is cleared after key derivation. Also validate that the resulting Cardano addresses match expected SLIP39 test vectors.
Security signals we found
Removal of explicit entropy.zeroize() call
Switch from mutable to immutable entropy reference
Change touches seed/entropy handling in a cryptocurrency hardware-wallet firmware
Commit message frames change as a fix but does not mention security
Evidence from the diff
In rust/rust_c/src/cardano/mod.rs, cardano_get_pubkey_by_slip23 is changed: extract_array_mut! is replaced with extract_array!, and entropy.zeroize() is removed. The function now passes an immutable, non-zeroized entropy slice to app_cardano::slip23::from_seed_slip23_path. The prior code created a mutable copy and zeroized it after key derivation, a common pattern to reduce the window in which seed entropy remains in memory. The patch removes that zeroization. The stated reason is to ‘fix ada slip39 address’, suggesting the previous mutable/zeroized path produced incorrect addresses or derivation failures, but no details are provided. The diff alone does not show whether the entropy buffer is still zeroized elsewhere, whether it is stack or heap memory, or whether the change introduces a practical information-disclosure vulnerability.
Changed components
rust/rust_c/src/cardano/mod.rscardano_get_pubkey_by_slip23 FFI functionCardano SLIP39 address/key derivationInspect captured patch +1 / −2
diff --git a/rust/rust_c/src/cardano/mod.rs b/rust/rust_c/src/cardano/mod.rs
index 0b70fec..890ace4 100644
--- a/rust/rust_c/src/cardano/mod.rs
+++ b/rust/rust_c/src/cardano/mod.rs
@@ -842,10 +842,9 @@ pub unsafe extern "C" fn cardano_get_pubkey_by_slip23(
))
.simple_c_ptr();
}
- let mut entropy = extract_array_mut!(entropy, u8, entropy_len as usize);
+ let entropy = extract_array!(entropy, u8, entropy_len as usize);
let path = recover_c_char(path).to_lowercase();
let xpub = app_cardano::slip23::from_seed_slip23_path(entropy, path.as_str());
- entropy.zeroize();
match xpub {
Ok(xpub) => {
SimpleResponse::success(convert_c_char(xpub.public().to_string())).simple_c_ptr()
Why this scored 54/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.