What changed, and why it matters
This commit fixes a minor but real security hygiene issue in the BitBox02 Plus hardware wallet. Before the patch, a 32-byte buffer meant to hold freshly generated random bytes for Bluetooth Low Energy (BLE) pairing security was not initialized. The code then immediately fills it with random data, so in normal operation the buffer is overwritten before use. However, if the random-generation function were to fail partially or unexpectedly, uninitialized memory could be used, which is poor practice for cryptographic material. The patch initializes the buffer to zeros as a safety net.
Treat as a low-severity hardening fix. Merge the patch and audit nearby code for similar uninitialized buffers used for cryptographic material. No urgent incident response is warranted unless additional evidence shows random_32_bytes can fail or return without fully writing the buffer.
Security signals we found
Uninitialized cryptographic buffer in security-critical reset routine
BLE identity key (IRK) and identity address derivation context
Defense-in-depth initialization of random material
Potential use of stack garbage if random generation behavior changes or fails
Evidence from the diff
In src/memory/memory.c, memory_reset_hww() declares uint8_t random_bytes[32] and then calls _interface_functions->random_32_bytes(&random_bytes[0]). The pre-patch code left the array uninitialized. The patch changes the declaration to uint8_t random_bytes[32] = {0};. This is a defense-in-depth fix: the buffer is intended to be fully overwritten by random_32_bytes, but zero-initialization ensures that any failure to write (e.g., a future implementation change, partial write, or unexpected early return path) does not leave stack garbage in a buffer later consumed for BLE identity-key (IRK) and identity-address setup. The diff itself does not show a reachable vulnerability path, only the removal of an uninitialized-variable risk in security-relevant code.
Changed components
src/memory/memory.cmemory_reset_hww()BLE bond database reset on BitBox02 PlusInspect captured patch +1 / −1
diff --git a/src/memory/memory.c b/src/memory/memory.c
index b73fef2..c544866 100644
--- a/src/memory/memory.c
+++ b/src/memory/memory.c
@@ -445,7 +445,7 @@ bool memory_reset_hww(void)
// Reset bond-db and reinitialize IRK and identity address
if (memory_get_platform() == MEMORY_PLATFORM_BITBOX02_PLUS) {
- uint8_t random_bytes[32];
+ uint8_t random_bytes[32] = {0};
_interface_functions->random_32_bytes(&random_bytes[0]);
chunk_shared_t chunk_shared = {0};
memory_read_shared_bootdata(&chunk_shared);
Why this scored 42/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.