BB
← All projectsBitBox

BitBox02 firmware

Firmware and bootloader for BitBox02 signing devices.

BitcoinHardware walletsNormal
Repository coverage

779 commits in the local evidence base

Every captured commit receives deterministic security triage and a separate communication-quality score. Security candidates and broader second-pass signals receive full-patch Ollama analysis.

231security candidates161second-pass queue719AI analyses
65commits · 30 days
136commits · 60 days
308commits · 180 days
692commits · 365 days
Backfill bands
Aug 5 → Feb 6335 seen28 candidatesComplete
Feb 6 → Jun 6265 seen19 candidatesComplete
Jun 6 → Jul 619 seen5 candidatesComplete
Jul 6 → Aug 526 seen3 candidatesComplete
Commit communication

Does the history explain itself?

Message quality measures whether a commit identifies its scope, purpose, rationale, testing, and supporting references. It does not change the security-severity score.

58/100 average clarity
68Strong · 80–100
321Adequate · 60–79
302Thin · 40–59
88Opaque · 0–39
26security candidates with opaque commit messaging
Read the scoring rubric →
Developer activity

Who is changing the project?

Public Git author strings; identities are not independently verified.

DeveloperCommitsCandidatesAnalyzedHigh riskMessage avg.
Marko Bencun450131422357
benma's agent11240106164
Niklas Dusenlund15139130057
cedwies12512063
Tomas Vrba10410071
Cedric Wiese12312049
Jad14210060
Sebastian Sutter222050
thisconnect212072
benma212074
Yasser Aziza111070
Niklas111035
Analysis record

Published AI watches

Last scanned 44 minutes ago

Low 34 AI analysisMessage 50 · Thin
BB BitBoxBitBox02 firmware BitcoinHardware wallets

Merge remote-tracking branch 'agent/benma-agent/hww-start-session'

This commit adds a new 'session reset' command to the BitBox02 hardware wallet's USB protocol. It lets the host computer cleanly reset the device connection if a previous operation was interrupted, instead of leaving the device stuck mid-t…

New USB control command added to host-wallet protocolReset path cancels async task, resets Noise state, unlocks USB processing, and clears output queueU2F UI ownership check prevents reset from interrupting an active U2F workflow
04302490by Marko Bencun+485−1713 files
No security note in commit
Informational 15 AI analysisMessage 78 · Adequate
BB BitBoxBitBox02 firmware BitcoinHardware wallets

py: make session reset an API setup helper

This is a routine Python code refactor. It moves an existing 'reset session' command from one internal class to another and adds a version check so older firmware simply skips it. There is no security bug being fixed here; it is purely org…

50a9e76aby benma's agent+28−163 files
No security note in commit
Moderate 62 AI analysisMessage 78 · Adequate
BB BitBoxBitBox02 firmware BitcoinHardware wallets

hww: reset sessions on host reconnect

This commit fixes a bug in the BitBox02 hardware wallet where unplugging the USB cable at the wrong moment could leave a half-finished operation running. If the device stayed powered and a new host reconnected, the new host's first message…

Fixes cross-session state confusion on USB reconnectAdds explicit session reset command to cancel stale async workflowsResets Noise cryptographic session to prevent old-key encrypted responses
6679936fby benma's agent+473−1712 files
Vendor flagged security relevance
Informational 17 AI analysisMessage 58 · Thin
BB BitBoxBitBox02 firmware BitcoinHardware wallets

Merge commit 'refs/pull/2073/head' of https://github.com/BitBoxSwiss/bitbox02-firmware

This commit adds a new recovery-word entry screen for the upcoming BitBox03 hardware wallet. It is a large feature patch: it introduces a dedicated BIP39 wordlist keyboard, a new recovery-words review screen, and changes how the device han…

New UI workflow distinguishes 'back' from 'cancel' during seed restoration, reducing accidental aborts.Cancel actions still require an explicit confirmation prompt before the restore is abandoned.Wordlist keyboard disables keys that cannot lead to a valid BIP39 word, preventing invalid-word compositions at the widget level.
6b04e006by Marko Bencun+7010−24621 files
No security note in commit
Low 47 AI analysisMessage 50 · Thin
BB BitBoxBitBox02 firmware BitcoinHardware wallets

Merge remote-tracking branch 'agent/benma-agent/show-erc20-contract'

This commit improves the BitBox02 hardware wallet's Ethereum token-approval screen. When a user signs an ERC20 token transfer, the device now also shows the token's smart-contract address if the token symbol is ambiguous (the same ticker, …

UI hardening: adds contract-address confirmation for ERC20 tokens with ambiguous or unknown symbolsRegistry validation: rejects payment requests for tokens not present in the firmware's ERC20 registryBuild-time ambiguity detection: generates a sorted list of units shared by multiple contracts
410df562by Marko Bencun+203−123 files
No security note in commit
Low 26 AI analysisMessage 50 · Thin
BB BitBoxBitBox02 firmware BitcoinHardware wallets

Merge remote-tracking branch 'agent/benma-agent/bootloader-descriptor-compat'

This commit relaxes a version check in the BitBox02 bootloader upgrade code. Previously, the firmware installer required that a stage0 bootloader descriptor's version exactly matched the currently expected image version. Now it accepts des…

Strict version equality check removed from bootloader descriptor parsingChange located in bootloader upgrade / firmware installer verification pathNo bounds, length, or pointer validation changes observed
6dccfd24by Marko Bencun+19−72 files
No security note in commit
Moderate 53 AI analysisMessage 45 · Thin
BB BitBoxBitBox02 firmware BitcoinHardware wallets

Merge branch 'nickez/bb02-utf8-safe'

This commit hardens the BitBox02 firmware so it stops trusting that incoming text strings are valid UTF-8 or plain ASCII. It replaces risky C string copies with length-checked, UTF-8-aware helpers, rejects non-ASCII characters at UI bounda…

Replaced snprintf-based string copies with length-bounded UTF-8-aware copiesAdded explicit length parameter to memory_set_device_name and reject embedded/invalid nullsAdded printable-ASCII enforcement at Rust UI boundary before C rendering
0bbdf6f0by Niklas Dusenlund+338−9625 files
No security note in commit
Low 41 AI analysisMessage 28 · Opaque
BB BitBoxBitBox02 firmware BitcoinHardware wallets

Merge branch 'benma/ub'

This commit fixes a coding guideline violation in the BitBox02 factory setup code. A 32-byte buffer that receives output from a Rust function was not initialized to zeroes before use. The accompanying documentation now explicitly requires …

Uninitialized stack buffer used as output buffer for Rust/C FFI callDefensive zero-initialization added to prevent use of stale stack data on error or partial write pathsProject coding guidelines updated to mandate zero-initialization for rust_util_bytes_mut buffers
8a6fd97bby Marko Bencun+3−12 files
No security note in commit
Low 35 AI analysisMessage 68 · Adequate
BB BitBoxBitBox02 firmware BitcoinHardware wallets

oled: hold display in reset during startup

This commit fixes a display behavior issue during startup of the BitBox02 hardware wallet. Previously, when the device turned on, the screen's reset pin was left in a state that could allow leftover images or text from an earlier session t…

Information disclosure via residual display content during bootOLED reset pin sequencing hardeningDefense against stale/misleading UI state before verified firmware initializes display
cdb27835by Niklas Dusenlund+2−11 file
Vendor flagged security relevance
Informational 18 AI analysisMessage 50 · Thin
BB BitBoxBitBox02 firmware BitcoinHardware wallets

Merge remote-tracking branch 'agent/benma-agent/factorysetup-trim-unused'

This commit trims the BitBox02 factory-setup firmware image by switching stored root attestation public keys from 65-byte uncompressed to 33-byte compressed secp256k1 keys, and by using a smaller static secp256k1 verification context inste…

Change in trusted public-key table format and derivation logicSwitch to static/no-precomp secp256k1 verification contextAddition of secp256k1 self-test at boot
554a0558by Marko Bencun+457−5647 files
No security note in commit
Low 37 AI analysisMessage 50 · Thin
BB BitBoxBitBox02 firmware BitcoinHardware wallets

Merge remote-tracking branch 'agent/benma-agent/validate-py-antiklepto-signatures'

This commit adds extra safety checks in the BitBox02 Python library for ECDSA signatures used in Bitcoin and Ethereum signing. It now validates that signatures have the correct length, use valid numbers, and use the safer low-S form. It al…

Defensive validation added for ECDSA signature format and low-S encodingRecovery ID range validation added for recoverable signaturesAnti-Klepto verification now rejects malformed/malleable signatures before nonce verification
0d1a7997by Marko Bencun+152−65 files
Vendor flagged security relevance
Informational 19 AI analysisMessage 50 · Thin
BB BitBoxBitBox02 firmware BitcoinHardware wallets

Merge remote-tracking branch 'agent/benma-agent/scroll-payment-request-memo-name'

This commit tweaks how the BitBox02 hardware wallet displays a payment-request memo on screen. It changes the label from 'Memo from\n\nMerchant' to 'Memo from: Merchant' and makes the screen scrollable so long merchant names don't get cut …

No security-relevant signal in commit message or diffUI/UX change only: text formatting and scrollabilityNo memory-safety, cryptographic, or authorization changes observed
be375664by Marko Bencun+115−66 files
No security note in commit
Informational 19 AI analysisMessage 91 · Strong
BB BitBoxBitBox02 firmware BitcoinHardware wallets

factorysetup: compress constant root keys

This commit is a hardening and size-optimization change for the BitBox02 factory-setup firmware. It stores the 110 built-in root attestation public keys in compressed (33-byte) form instead of uncompressed (65-byte) form, and marks the tab…

Data table moved from writable RAM to read-only flash (const)Public-key table size reduced from 65 to 33 bytes per keyNew Rust helper normalizes compressed/uncompressed keys before hashing
e2273c1fby benma's agent+407−5552 files
No security note in commit
Informational 18 AI analysisMessage 78 · Adequate
BB BitBoxBitBox02 firmware BitcoinHardware wallets

factorysetup: reuse SHA-256 for HMAC

This commit swaps one internal cryptography library for another when computing HMAC-SHA256 in the factory-setup code. The goal is to reduce firmware size by reusing an existing SHA-256 implementation, not to fix a security bug. New test ve…

Cryptographic implementation change in HMAC-SHA256 helperUse of `.unwrap()` on `new_from_slice`, which can panic if key length is unsupported; for HMAC-SHA256 the RustCrypto `new_from_slice` accepts any key length, so this is effectively safe but still a panic pathNo removal of existing call sites; normal firmware still uses `bitcoin_hashes` for other callers
a790a7f0by benma's agent+24−55 files
No security note in commit
Informational 21 AI analysisMessage 78 · Adequate
BB BitBoxBitBox02 firmware BitcoinHardware wallets

factorysetup: use static secp context

This commit changes how the BitBox02 factory-setup program checks digital signatures. It switches from a dynamically created crypto context to a built-in, read-only verification context, which makes the factory-setup firmware about 35 KB s…

Cryptographic context change in verification pathRemoval of dynamic secp256k1 context creation in factory setupExplicit addition of secp256k1_selftest() to compensate for skipped implicit self-test
2756aca4by benma's agent+26−42 files
No security note in commit
Informational 18 AI analysisMessage 73 · Adequate
BB BitBoxBitBox02 firmware BitcoinHardware wallets

factorysetup: speed up certificate setup

This commit is a performance optimization in the BitBox02 factory setup process. It changes how the device picks which trusted root public key to use when verifying an attestation certificate. Previously, the device tried verifying the sig…

No removal of cryptographic verification: rust_secp256k1_verify is still performed after key selection.No change to accepted inputs: any certificate accepted before is still accepted, and any rejected before is still rejected.Identifier comparison uses MEMEQ over the full 32-byte SHA-256 digest, so collision resistance is standard.
d5617112by benma's agent+10−81 file
No security note in commit
Informational 15 AI analysisMessage 45 · Thin
BB BitBoxBitBox02 firmware BitcoinHardware wallets

Merge branch 'nickez/bb03-binaries'

This commit is a large feature merge that adds initial support for a new hardware variant, the BitBox03 (STM32U5-based development kit). It introduces new bootloader and firmware binaries, board support crates, vendored Rust dependencies (…

1a648595by Niklas Dusenlund+17103−5779170 files
No security note in commit
Informational 15 AI analysisMessage 58 · Thin
BB BitBoxBitBox02 firmware BitcoinHardware wallets

Merge commit 'refs/pull/1976/head' of https://github.com/BitBoxSwiss/bitbox02-firmware

This commit adds a progress bar that appears while the BitBox02 is loading large Ethereum transaction data from a connected computer. It is a user-experience improvement, not a security fix. The code only changes how progress is displayed …

386d86f5by Marko Bencun+139−134 files
No security note in commit
Informational 15 AI analysisMessage 35 · Opaque
BB BitBoxBitBox02 firmware BitcoinHardware wallets

Add testboard openocd config

This commit adds a configuration file for OpenOCD, a debugging tool used during hardware development and testing. It tells the debugger how to connect to an STM32U5 test board using a J-Link adapter. There is no change to firmware code, no…

c5984b41by Niklas Dusenlund+16−01 file
No security note in commit
Informational 19 AI analysisMessage 28 · Opaque
BB BitBoxBitBox02 firmware BitcoinHardware wallets

Merge branch 'py-proto'

This commit only adds explanatory comments to Python type-stub files describing what happens when an optional anti-klepto host nonce commitment is left out. It does not change any firmware logic, cryptographic code, or default behavior. Th…

Documentation-only change in generated Python stubsMentions anti-klepto / S2C nonce commitment fallback behaviorNo logic, default, or cryptographic implementation change
926a5885by Marko Bencun+28−62 files
No security note in commit
Repository ledger

Explore captured commits

Expand any commit for its author, full message, clarity score, changed files, triage signals, analysis, and source link.

Security candidateAdd flash data backup scriptsby Niklas Dusenlund · 285fa768 · Jun 23, 2026 · 3 filesMessage 73 · AdequateInformational 15Details
Commit message · Niklas Dusenlund

Add flash data backup scripts

Add J-Link helper scripts to back up and restore the BitBox02 flash data
areas: shared data, appdata, and bootdata. The backup records the MCU
serial number but does not include bootloader factory randomness.

73/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Names security-relevant behavior explicitly
Why it was queued
update trust
AI analysis · Informational 15/100

This commit adds two helper scripts for developers to back up and restore BitBox02 flash memory areas using a Segger J-Link debugger. The scripts require physical hardware access and a debugging probe, and they are not part of the firmware that runs on the device. They do not change any device code or introduce a remote attack path.

Security candidatebb03 UI: placeholder BTC signing workflowsby Jad · f7b0b082 · Jun 15, 2026 · 1 fileMessage 40 · ThinInformational 15Details
Commit message · Jad

bb03 UI: placeholder BTC signing workflows

Implement placeholder UI for BTC signing demos
in send_message.py.

40/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body! Contains work-in-progress language
Why it was queued
signing boundary
AI analysis · Informational 15/100

This commit replaces unfinished placeholder code (which would crash with 'todo!()') with simple working user-interface placeholders for Bitcoin signing demonstrations. It adds basic on-screen prompts to confirm a recipient/amount and a total/fee, and makes progress/empty UI elements return real objects instead of crashing. There is no security issue visible in the diff; it is routine UI scaffolding.

Security candidateBump Rust toolchain to 1.96by Niklas Dusenlund · 55e3dd30 · Jun 3, 2026 · 360 filesMessage 78 · AdequateInformational 17Details
Commit message · Niklas Dusenlund

Bump Rust toolchain to 1.96

Update the pinned Rust toolchain to 1.96.0 and adjust the BTC signtx
tests for clippy's collapsible_match lint on the new toolchain.

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
cryptography-sensitive pathsigning or wallet pathauthentication path
AI analysis · Informational 17/100

This commit is a routine maintenance update for the BitBox02 hardware wallet firmware. It upgrades the pinned Rust compiler toolchain from an older version to Rust 1.96.0, updates the project's Docker build container and related developer tools (like clang-format and clang-tidy) from version 21 to 22, and refreshes several vendored Rust library dependencies to newer versions. The only application code change is a small test-only cleanup in the Bitcoin transaction signing tests to satisfy a new Rust linter warning. There is no direct evidence in the commit message or diff that this fixes a specific security vulnerability.

Security candidatebootloader: reduce snprintfby Marko Bencun · 2fb9d57f · Jun 2, 2026 · 6 filesMessage 68 · AdequateInformational 18Details
Commit message · Marko Bencun

bootloader: reduce snprintf

Move the BLE dev menu version formatting to the fixed-format
bootloader formatter and add unit coverage.

Extend the unwanted-symbol check to regular development and production
bootloader outputs.

Reduces binary size.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
update trustboot or update path
AI analysis · Informational 18/100

This commit removes the use of the standard snprintf formatting function from the BitBox02 bootloader's developer menu and replaces it with a small, fixed-format helper. The main goal is to reduce the bootloader's binary size and make the project's automated checks apply to all bootloader builds, not just production ones. There is no direct evidence this fixes an active security vulnerability, but it is a defensive hardening change that reduces attack surface by avoiding a complex formatting library in security-sensitive bootloader code.

Security candidatebootloader: hash BLE firmware in Cby Marko Bencun · 1d82b8a4 · May 30, 2026 · 2 filesMessage 68 · AdequateInformational 12Details
Commit message · Marko Bencun

bootloader: hash BLE firmware in C

Use the existing PUKCC SHA-256 path for the bootloader BLE firmware hash check. Firmware
builds keep using the Rust SHA-256 wrapper.

Saves 1352 bytes in bb02p-bl-multi-production.bin.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
update trust
AI analysis · Informational 12/100

This commit is a code-size optimization for the BitBox02 bootloader. It switches the Bluetooth Low Energy (BLE) firmware hash verification from a Rust SHA-256 implementation to an existing C-based SHA-256 implementation already used by the bootloader. The change saves 1,352 bytes and adds a CI check to prevent the larger Rust SHA-256 code from creeping back into production bootloaders. There is no indication this fixes a security vulnerability.

Security candidatebootloader: avoid snprintf formattingby Marko Bencun · 33434fa9 · May 30, 2026 · 14 filesMessage 63 · AdequateLow 35Details
Commit message · Marko Bencun

bootloader: avoid snprintf formatting

Replace the extracted bootloader formatting helpers with fixed-size string building.

Add a small Rust decimal formatter for the fixed integer cases.

Remove the remaining production bootloader snprintf pulls from debug copies and UGUI line slicing.

Also replace the Plus BLE random-name formatting.

Extend the unwanted-symbols CI check to cover production bootloader ELFs.

Reject stdio and Rust formatting symbols there.

63/100 · AdequateMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context✓ Names security-relevant behavior explicitly
Why it was queued
update trustboot or update path
AI analysis · Low 35/100

This commit removes the use of standard string-formatting functions (like snprintf and Rust's format!) from the bootloader and related low-level code, replacing them with smaller, fixed-size string builders. The stated goal is to reduce binary size ('bloat') in the production bootloader, not to fix a known security bug. The change also adds a CI check that rejects any future use of these formatting symbols in production bootloader builds. While removing complex formatting libraries from a bootloader is generally good defensive practice, the commit itself does not describe or demonstrate any exploitable vulnerability.

Security candidatebootloader: extract formatting helpersby Marko Bencun · 1a1de3b5 · May 30, 2026 · 6 filesMessage 35 · OpaqueInformational 15Details
Commit message · Marko Bencun

bootloader: extract formatting helpers

35/100 · OpaqueMessage clarity
✓ Descriptive subject! No meaningful explanatory body! Opaque security-relevant change
Why it was queued
update trustboot or update path
AI analysis · Informational 15/100

This commit is a simple code cleanup: it moves a handful of string-formatting helpers (for pairing codes, progress percentages, hash display, timers, and unknown-command messages) out of the main bootloader file into a new dedicated file, and adds unit tests for them. The actual formatting logic is unchanged, and there is no indication of any security fix or behavior change.

Security candidatebootloader: render messages directlyby Marko Bencun · c0bc7b92 · May 30, 2026 · 1 fileMessage 58 · ThinInformational 17Details
Commit message · Marko Bencun

bootloader: render messages directly

Pass bootloader messages directly to UG_PutString instead of copying them through a fixed-size stack buffer first. UG_PutString consumes the string synchronously while drawing to the screen buffer.

58/100 · ThinMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context
Why it was queued
update trustboot or update path
AI analysis · Informational 17/100

This commit removes a 100-character stack buffer and passes bootloader messages straight to the screen-drawing function. The old code used snprintf to copy the message into a fixed-size buffer, which could silently truncate very long strings. There is no direct evidence in the commit that this fixed a security vulnerability; it appears to be a cleanup or robustness improvement. The change does not introduce obvious new risks because the drawing function consumes the string immediately.

Security candidateUse 9x9 bootloader screen fontby Marko Bencun · f66bc5ef · May 30, 2026 · 1 fileMessage 68 · AdequateInformational 15Details
Commit message · Marko Bencun

Use 9x9 bootloader screen font

The bootloader selects the 9x9 font before rendering text, and Abort does the
same. Use that font as the bootloader UG_Init default so the 11x10 font table is
not linked into bootloader images.

bb02p-bl-multi-production.bin shrinks from 50572 to 48556 bytes.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
update trust
AI analysis · Informational 15/100

This commit changes the default on-screen font used by the bootloader from an 11x10 pixel font to a 9x9 pixel font. The only stated purpose is to make the bootloader firmware file smaller by avoiding inclusion of the larger font's data table. There is no indication this fixes a security vulnerability.

Security candidateUse integer progress fractionsby Marko Bencun · 17c4947f · May 29, 2026 · 12 filesMessage 58 · ThinInformational 19Details
Commit message · Marko Bencun

Use integer progress fractions

Add an integer `set_fraction()` progress path through the HAL and UI layers,
and switch the live Bitcoin-signing and Bluetooth-upgrade progress updates to
use it.

The progress bar ultimately renders whole pixels, so the C progress component
now stores the filled pixel width directly and computes it with integer math.
This keeps the visible behavior intact while removing the Rust-side soft-float
`f32` arithmetic path that was only used for progress updates.

In the final firmware image this drops the live
`compiler_builtins::float::{add,div,mul}::<f32>` helpers together with the
associated `__aeabi_fadd`, `__aeabi_fdiv`, and `__aeabi_fmul` wrappers.

Savings: 1352 bytes

58/100 · ThinMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context
Why it was queued
signing boundarysigning or wallet path
AI analysis · Informational 19/100

This commit replaces floating-point progress calculations with integer math to save firmware space. It removes the use of f32 arithmetic for progress bars in Bitcoin transaction signing and Bluetooth firmware upgrades. There is no direct security vulnerability in the change itself; it is a code-quality and size-reduction refactor. However, it introduces new integer arithmetic paths that must keep numerator/denominator assumptions valid to avoid incorrect progress display.

Security candidateRemove inverted ugui text argumentby Niklas Dusenlund · 323f2061 · May 18, 2026 · 19 filesMessage 78 · AdequateInformational 20Details
Commit message · Niklas Dusenlund

Remove inverted ugui text argument

Replace the text-specific inverted flag with a temporary 180-degree UG
rendering transform. Use the component helper to rotate the orientation
screen top button while keeping normal text drawing APIs.

Update C and Rust call sites and add coverage for pixel and component
rotation.

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
boot or update path
AI analysis · Informational 20/100

This commit is a user-interface cleanup: it removes a special 'draw text upside-down' flag from the graphics library and instead uses a generic 180-degree rotation helper when the screen is flipped. It does not fix a security vulnerability and does not appear to introduce one. The change is mostly about simplifying how text and buttons are rendered on the BitBox02 hardware wallet screen.

Security candidateEnable scope C LTO for firmwareby Marko Bencun · 0b102fb7 · May 17, 2026 · 6 filesMessage 80 · StrongInformational 12Details
Commit message · Marko Bencun

Enable scope C LTO for firmware

Enable scoped GCC LTO for firmware C code to reduce ROM size while preserving section GC and stack protector support. Build firmware C objects plus the optiga and cryptoauthlib static libraries with -flto -ffat-lto-objects, and link only firmware images with -flto, since useful size savings require LTO IR in the linked static libraries.

Switch the ARM toolchain to the LTO-aware archive utilities (arm-none-eabi-gcc-ar, arm-none-eabi-gcc-nm, arm-none-eabi-gcc-ranlib); plain ar/ranlib can archive LTO objects without the plugin and produce invalid tiny images by failing to extract live objects.

Keep bootloaders, factory-setup, ASF4, samd51a-ds, and embedded-swd
off the LTO path because startup, interrupt, MMIO, vector-table,
linker-script, assembly, callback-table, and section-name interactions
are not cheaply auditable for LTO safety. Mark local stack protector
symbols as kept/visible so late LTO-generated references to
__stack_chk_fail and __stack_chk_guard are retained;
no_stack_protector is intentionally not needed.

80/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
Why it was queued
update trustboot or update path
AI analysis · Informational 12/100

This commit changes the build system to enable Link-Time Optimization (LTO), a compiler technique that shrinks the final firmware size. It also adds safeguards to keep the stack protector security feature working under LTO and deliberately excludes sensitive low-level code (bootloader, factory setup, hardware drivers) from LTO to avoid subtle bugs. There is no direct evidence in the commit of a security vulnerability being fixed or introduced.

Security candidateAdd bitbox03-factorysetupby Niklas Dusenlund · f66cee6e · May 7, 2026 · 11 filesMessage 35 · OpaqueInformational 15Details
Commit message · Niklas Dusenlund

Add bitbox03-factorysetup

35/100 · OpaqueMessage clarity
✓ Descriptive subject! No meaningful explanatory body! Opaque security-relevant change
Why it was queued
boot or update path
AI analysis · Informational 15/100

This commit adds a new factory-setup helper program for the BitBox03 hardware wallet and moves some debug logging code around. It does not change the main wallet firmware's security behavior. There is no indication this fixes or introduces a security vulnerability.

Security candidateAdd bitbox03-firmwareby Niklas Dusenlund · 7dce6b6a · May 7, 2026 · 10 filesMessage 28 · OpaqueInformational 15Details
Commit message · Niklas Dusenlund

Add bitbox03-firmware

28/100 · OpaqueMessage clarity
✓ Subject identifies a change! No meaningful explanatory body! Opaque security-relevant change
Why it was queued
boot or update path
AI analysis · Informational 15/100

This commit adds a brand-new, minimal firmware binary for the BitBox03 hardware wallet. It is essentially a development stub: it initializes the board, sets up a debug logger, prints a log message, and then halts. There is no user-facing functionality, no cryptographic code, and no security-sensitive logic introduced in this change. It is a build-system and scaffolding addition, not a security fix or vulnerability.

Security candidateda14531: restore BLE UART backpressureby Marko Bencun · 3201c5d2 · Apr 28, 2026 · 7 filesMessage 95 · StrongModerate 60Details
Commit message · Marko Bencun

da14531: restore BLE UART backpressure

ListBackups returns one protobuf containing all SD card backups. With many backups, the response spans many 64-byte HWW/U2FHID reports. USB sends those reports directly over HID, but BLE first serial-frames each report for the DA14531 and queues the escaped bytes in the fixed-size UART ByteQueue.

The Rust ByteQueue port kept the panicking single-byte put() API and the BLE poller used it for every framed byte. That removed the previous v9.25 backpressure behavior: da14531_protocol_poll() consumed the pending HWW report before knowing whether the whole framed BLE packet fit in the 2048-byte UART queue. If ListBackups produced data faster than UART drained it, put() eventually hit capacity and panicked with bytequeue overflow. USB does not use this UART queue, which is why the same request worked there.

Add ByteQueue::try_put_slice() plus an extern C wrapper that takes util::Bytes and performs an all-or-nothing enqueue. The BLE HWW path now formats the 64-byte report into a temporary serial frame and only clears hww_data after try_put_slice() succeeds. If the queue is full, it returns without writing any bytes, preserving frame boundaries and leaving the same report pending for the next poll after UART has drained.

Keep the existing panicking put() behavior for the other bytequeue callers so the change stays scoped to the actual backpressure boundary. The separate Rust and extern-wrapper tests cover successful writes and failed overflow attempts being atomic.

95/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification✓ Names security-relevant behavior explicitly
Why it was queued
memory safetyparser or protocol path
AI analysis · Moderate 60/100

This update fixes a crash in the BitBox02 hardware wallet when a user lists many backups over a Bluetooth connection. Previously, the device could run out of temporary buffer space while sending a large response, causing it to panic and stop working. The fix makes the Bluetooth sender check whether the whole next chunk fits before writing it, and if not, wait until space becomes available. USB connections were not affected because they use a different path.

Security candidateShrink secp256k1 callbacksby Marko Bencun · 51964811 · Apr 22, 2026 · 2 filesMessage 58 · ThinInformational 14Details
Commit message · Marko Bencun

Shrink secp256k1 callbacks

Override libsecp256k1's default callbacks with tiny local stubs.

The vendored callbacks print an error and then call abort(). In the
firmware image those failure-only paths pull in a large chunk of newlib
stdio and signal handling even though the callbacks are only used for
fatal illegal-argument and internal-consistency failures and must never
return.

Saved: 2672 bytes

The final linked image drops the abort/stdio path retained only by those
callbacks, including the public symbols abort, raise, _raise_r,
_kill_r, _getpid_r, fprintf, printf, and _vfprintf_r. It also drops the
private stdio helpers behind them, such as __sfputc_r, __sfputs_r,
__swsetup_r, __swbuf_r, _fflush_r, _fwalk_sglue, __swhatbuf_r,
__swrite, __sread, __sseek, __sclose, __sinit, and __smakebuf_r.
Meanwhile secp256k1_default_illegal_callback_fn and
secp256k1_default_error_callback_fn shrink from 28 bytes each to 2
bytes each.

This keeps the relevant behavior intact: both callbacks still trap the
firmware in a non-returning fatal path, but without dragging in unused
diagnostic formatting code.

58/100 · ThinMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context
Why it was queued
cryptography-sensitive path
AI analysis · Informational 14/100

This commit is a size-optimization cleanup, not a security fix. It replaces libsecp256k1's default fatal-error callbacks with smaller stubs so the firmware binary no longer pulls in unused standard-library printing and abort code. The behavior stays the same: on an internal or illegal-argument failure, the device still hangs forever instead of returning.

Security candidatesecurechip: port attestation signby Marko Bencun · 2bccdebf · Apr 22, 2026 · 25 filesMessage 35 · OpaqueInformational 20Details
Commit message · Marko Bencun

securechip: port attestation sign

35/100 · OpaqueMessage clarity
✓ Descriptive subject! No meaningful explanatory body! Opaque security-relevant change
Why it was queued
update trustboot or update path
AI analysis · Informational 20/100

This commit is a code refactoring that moves the device attestation signing function from C code into Rust code. It converts the function to be asynchronous (async/await) and rewrites the parsing of the secure chip's DER-encoded signature in Rust. There is no direct evidence in the commit that this fixes a security vulnerability; it appears to be a normal portability and maintainability improvement. The change does add safety checks for signature length and zeroizes sensitive buffers after use, which are good defensive practices.

Security candidatesecurechip: make random asyncby Marko Bencun · 797a37e6 · Apr 22, 2026 · 17 filesMessage 40 · ThinLow 33Details
Commit message · Marko Bencun

securechip: make random async

40/100 · ThinMessage clarity
✓ Descriptive subject✓ Names security-relevant behavior explicitly! No meaningful explanatory body
Why it was queued
seed or entropy path
AI analysis · Low 33/100

This commit rewrites how the BitBox02 hardware wallet fetches random numbers from its secure chip. Previously, the secure chip's random generator was called in a blocking (synchronous) way. The change makes it asynchronous, so the firmware can do other work while waiting. It also removes an older, simpler random interface and now mixes the secure-chip randomness with the microcontroller's own randomness before using it for sensitive key material. The commit itself is a defensive refactor; it does not appear to fix a known exploit, but it removes a synchronous call that could stall the device and strengthens how random values are combined when creating password-stretching secrets.

Security candidateassert 9.26.1by Niklas Dusenlund · 0b6e2efb · Apr 22, 2026 · 2 filesMessage 28 · OpaqueInformational 15Details
Commit message · Niklas Dusenlund

assert 9.26.1

28/100 · OpaqueMessage clarity
✓ Subject identifies a change! No meaningful explanatory body! Opaque security-relevant change
Why it was queued
boot or update path
AI analysis · Informational 15/100

This commit only adds two new digital signature files for an already-released firmware version (9.26.1). These signatures are used by independent builders to publicly attest that they reproduced the official firmware exactly from source code. No code, no firmware binary, and no behavior of the device changed. There is nothing here that could affect security of the BitBox02 itself.

Security candidateFormat generated protobufs explicitlyby Niklas Dusenlund · f22f12cd · Apr 22, 2026 · 3 filesMessage 58 · ThinInformational 15Details
Commit message · Niklas Dusenlund

Format generated protobufs explicitly

Run rustfmt from the explicit protobuf regeneration script and include
the generated Rust files in check-style.

This keeps firmware builds working by avoiding formatting inside the
generator/build path while making the manual regen workflow produce
style-clean committed outputs.

58/100 · ThinMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context
Why it was queued
cryptography-sensitive pathparser or protocol path
AI analysis · Informational 15/100

This commit is purely a code-style and build-maintenance change. It makes the Rust code generated from protocol-buffer definitions be formatted by rustfmt automatically and included in style checks. No security-sensitive behavior is changed.

Security candidateMove protobuf bindings into bitbox-protoby Niklas Dusenlund · 06f33ef3 · Apr 22, 2026 · 21 filesMessage 68 · AdequateInformational 15Details
Commit message · Niklas Dusenlund

Move protobuf bindings into bitbox-proto

Add a committed bitbox-proto crate for the generated Rust protobuf
bindings.

Switch regeneration to a Cargo-driven flow, add a make shortcut and CI
drift check, and keep the generator copy-on-change so no-op regen runs
do not churn timestamps or invalidate build caches.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
defensive validationcryptography-sensitive pathsigning or wallet pathparser or protocol path
AI analysis · Informational 15/100

This commit is a build-system and code-organization refactor. It moves the automatically generated Rust protobuf message definitions from inside the main bitbox02-rust crate into a new, separate bitbox-proto crate. It also switches the generation flow from CMake to Cargo, adds a CI check to ensure the committed generated files stay in sync with the .proto source files, and avoids touching timestamps when regeneration produces identical output. There is no change to the actual device firmware logic or to how messages are parsed and validated.

Security candidatesecurechip: port password opsby Marko Bencun · 9bd67713 · Apr 21, 2026 · 27 filesMessage 68 · AdequateLow 34Details
Commit message · Marko Bencun

securechip: port password ops

Move the OPTIGA password flows into Rust in one step, including the async command wrappers and the migrated unit tests. This keeps the commit focused on the securechip password migration itself; the unrelated Box::pin(...) call-site changes were split into a separate commit.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
cryptography-sensitive path
AI analysis · Low 34/100

This commit is a large refactoring that moves the password-stretching and secure-chip password operations from C into Rust for the BitBox02 firmware. It does not add new user-facing features or change the cryptographic algorithm; it reimplements the same OPTIGA secure-chip flows (HMAC verification, symmetric encryption, key generation, counter resets) in Rust with async wrappers. The old C implementation and its unit tests are removed, and equivalent Rust unit tests with deterministic fakes are added. There is no indication in the commit that this fixes a known security vulnerability.

Security candidateutil/sha2: fix safety docs syntaxby Marko Bencun · c0f75679 · Apr 21, 2026 · 1 fileMessage 45 · ThinInformational 15Details
Commit message · Marko Bencun

util/sha2: fix safety docs syntax

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
Why it was queued
cryptography-sensitive path
AI analysis · Informational 15/100

This commit only reformats the Rust documentation comments for unsafe functions so they use the standard '# Safety' heading. No actual code logic, memory handling, or behavior changed. It is a documentation cleanup with no security impact.

Security candidatesecurechip: change output type of password stretch to [u8; 32]by Marko Bencun · 3992ca43 · Apr 21, 2026 · 9 filesMessage 50 · ThinInformational 15Details
Commit message · Marko Bencun

securechip: change output type of password stretch to [u8; 32]

Encode size in type for clarity.

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
Why it was queued
signing boundary
AI analysis · Informational 15/100

This commit is a straightforward code cleanup: it changes the return type of password-stretching functions from a variable-length byte list to a fixed 32-byte array, because the result is always exactly 32 bytes. The change makes the code clearer and lets the compiler enforce the size, but it does not fix any security bug or change behavior.

Security candidateui: don't show waiting screen during password stretchby Marko Bencun · 22cadd6c · Apr 20, 2026 · 15 filesMessage 73 · AdequateInformational 15Details
Commit message · Marko Bencun

ui: don't show waiting screen during password stretch

Before the securechip operations became async, the UI did not process
during keystore unlock and froze at the last screen of the password
confirmation, and UI continued with the BIP39 unlock animation.

Now that they are async, the password screen is popped and the waiting
screen would be shown for roughly 1s before the unlock animation
started. To improve UI there, we start showing first screen of the
unlock animation (the locked lock) as the filler screen.

Instead of the default waiting screen being shown, during these
operations the first animation frame component is shown and held, with
animation starting only in bip39_unlock.

The downside is that when entering the wrong password, it is also
briefly shown before the wrong-password error message, but it's
acceptable.

There are other workflows where the waiting screen is also shown
during the stretch, not addresed by this commit: show mnemonic, create
backup, and change password (any call to
`workflows::unlock::unlock_keystore()` to check the password).

Co-Authored-By: Niklas Dusenlund <niklas.dusenlund@bitbox.swiss>

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
secret or key material
AI analysis · Informational 15/100

This commit is a user-interface polish change for the BitBox02 hardware wallet. It replaces a generic 'waiting' spinner with the first frame of the unlock animation while the device is busy stretching the user's password. There is no security vulnerability or fix here—only a visual improvement to make the device look smoother during unlock.