BB
← All projectsBitBox

BitBox02 firmware

Firmware and bootloader for BitBox02 signing devices.

BitcoinHardware walletsNormal
Repository coverage

938 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.

314security candidates186second-pass queue827AI analyses
88commits · 30 days
150commits · 60 days
340commits · 180 days
723commits · 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.

59/100 average clarity
86Strong · 80–100
381Adequate · 60–79
381Thin · 40–59
90Opaque · 0–39
27security 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 Bencun504157459656
benma's agent15566140267
Niklas Dusenlund17151144057
Cedric Wiese24919051
NickeZ Agent1669077
cedwies12512063
Sebastian Sutter655060
Tomas Vrba12410068
Yasser Aziza333070
Jad14210060
benma312069
Niklas211054
Analysis record

Published AI watches

Last scanned 51 minutes ago

Informational 12 AI analysisMessage 50 · Thin
BB BitBoxBitBox02 firmware BitcoinHardware wallets

Merge remote-tracking branch 'agent/benma-agent/remove-aes-hmac-c-exports'

This commit removes unused C-language export functions for AES encryption/HMAC from the BitBox02 firmware's Rust code. It is a cleanup change: the functions are deleted, the crate is no longer included in firmware builds, and simulators st…

Reduction of C FFI attack surface by removing no_mangle AES/HMAC exportsDependency cleanup: bitbox-aes no longer linked into firmware or simulatorsNo patch of an identified vulnerability in cryptographic logic
0b6365c6by Marko Bencun+2−5913 files
No security note in commit
Low 43 AI analysisMessage 50 · Thin
BB BitBoxBitBox02 firmware BitcoinHardware wallets

Merge remote-tracking branch 'agent/benma-agent/btc-root-xpub-m49'

This firmware update makes two changes to how the BitBox02 hardware wallet handles Bitcoin-related requests. First, it blocks apps from exporting the wallet's master public key (the 'root xpub') at the top-level path 'm/'. Second, it allow…

Root xpub export blocked at empty keypath (m/)Changelog describes root-xpub restriction as a security-relevant changeExternal service message signing expanded to m/49 unhardened purpose
5294645cby Marko Bencun+79−195 files
Vendor flagged security relevance
Informational 17 AI analysisMessage 78 · Adequate
BB BitBoxBitBox02 firmware BitcoinHardware wallets

cipher: remove unused AES-HMAC C exports

This commit removes two unused C-language bridge functions that wrapped an AES-HMAC encryption/decryption module. The functions themselves were not called from C code; the firmware now calls the same encryption logic directly from Rust. Re…

Removal of C FFI wrappers that could panic on malformed inputsCommit message acknowledges potential panic conditions (invalid IV length, undersized output buffer)No functional change to the underlying AES-HMAC implementation
090a263fby benma's agent+2−5913 files
Vendor flagged security relevance
Low 34 AI analysisMessage 85 · Strong
BB BitBoxBitBox02 firmware BitcoinHardware wallets

u2f: bound DER signature component reads

This commit fixes a small but real bug in how U2F signature components are converted to DER format. The old code could strip too many leading zeros and then read past the end of a 32-byte signature piece, potentially producing an invalid o…

Out-of-bounds read at component boundary during DER encodingPotential malformed DER output for all-zero signature componentDefensive hardening in U2F signature handling
dd17bed7by benma's agent+21−43 files
Vendor flagged security relevance
Low 30 AI analysisMessage 78 · Adequate
BB BitBoxBitBox02 firmware BitcoinHardware wallets

btc: allow message signing under m/49

This commit expands the BitBox02 hardware wallet's Bitcoin message-signing feature to also accept key paths starting with the unhardened purpose 'm/49'. Previously only hardened m/45' and m/48' were treated as valid 'external service' keyp…

Relaxation of keypath allowlist for message signingUnhardened purpose m/49 added to external-service signing namespaceUser confirmation prompt still required ('External service key')
1f377f72by benma's agent+63−194 files
No security note in commit
High 72 AI analysisMessage 73 · Adequate
BB BitBoxBitBox02 firmware BitcoinHardware wallets

btc: reject master xpub exports

This commit closes a security gap in the BitBox02 hardware wallet's Bitcoin API. Previously, a host app could ask the device to export the 'master xpub' (the public key at the very top of the wallet, keypath m/). Combined with any leaked p…

Master xpub export preventedPrivate-key derivation risk described in commit messageUnhardened path key compromise scenario
c4524b15by benma's agent+16−02 files
Vendor flagged security relevance
Informational 15 AI analysisMessage 50 · Thin
BB BitBoxBitBox02 firmware BitcoinHardware wallets

Merge branch 'nickez-agent/configure-stage1-embedding'

This commit is a build-system refactor for the BitBox02 hardware wallet firmware. It replaces a set of separate 'bootloader upgrade' firmware images with a configurable option to embed the same bootloader update data into the normal firmwa…

70a32f5bby Niklas Dusenlund+152−33111 files
No security note in commit
High 70 AI analysisMessage 50 · Thin
BB BitBoxBitBox02 firmware BitcoinHardware wallets

Merge remote-tracking branch 'agent/benma-agent/merge-firmware-v9.29.0'

This firmware update hardens how the BitBox02 handles SwapKit-style cryptocurrency swaps and Bitcoin multisig addresses. It adds a new 'refund memo' to payment requests so the device can verify that any refund address belongs to the same w…

CHANGELOG labels prior changes as 'Bitcoin security fixes (multisig keypath and previous-transaction hash length validation)'CHANGELOG labels v9.29.0 as 'Require wallet-owned refund addresses for SwapKit'New RefundMemo protobuf message with address and optional derivation info
9b16af63by Marko Bencun+867−12411 files
Vendor flagged security relevance
Moderate 60 AI analysisMessage 50 · Thin
BB BitBoxBitBox02 firmware BitcoinHardware wallets

Merge remote-tracking branch 'agent/benma-agent/merge-bootloader-v1.2.3'

This commit hardens the BitBox02 bootloader's stored version-rollback protection data. It adds a SHA-256 checksum over the firmware and signing-key version 'floors' and a one-time migration marker, so the device can detect tampering or cor…

Adds integrity checksum (SHA-256) for anti-rollback version floors in bootloader flash dataIntroduces one-time migration marker to prevent repeated downgrade/migration windowsProduction bootloader now aborts on invalid bootdata instead of silently reinitializing it
a4ddb764by Marko Bencun+2124−3123 files
Vendor flagged security relevance
Informational 15 AI analysisMessage 50 · Thin
BB BitBoxBitBox02 firmware BitcoinHardware wallets

Merge remote-tracking branch 'agent/benma-agent/high-fee-wording-v9.27.2'

This commit only updates test data and test expectations to reflect that a wording change for high Bitcoin transaction fees was released in firmware version 9.27.2 instead of 9.28.0. It does not change any device firmware code, security lo…

00f9eb22by Marko Bencun+65−1123 files
No security note in commit
Informational 15 AI analysisMessage 68 · Adequate
BB BitBoxBitBox02 firmware BitcoinHardware wallets

btc: fix high-fee wording cutoff in vectors

This commit only updates test data and test expectations for the BitBox02 firmware. It changes which firmware versions are expected to show an old versus new high-fee warning message, because the real firmware already started showing the n…

dc5702d0by benma's agent+65−1123 files
No security note in commit
High 77 AI analysisMessage 50 · Thin
BB BitBoxBitBox02 firmware BitcoinHardware wallets

Merge remote-tracking branch 'agent/benma-agent/stage0-reject-zero-signatures'

This update hardens the BitBox02 hardware wallet's bootloader so it refuses to accept a firmware update signed with an all-zero signature. Previously, the cryptographic verification routine could treat a zero-filled signature as valid unde…

Rejects all-zero ECDSA signatures that may verify as validAdds volatile signature read to mitigate LTO-based read eliminationORs all signature bytes without early exit to ensure full-byte inspection
aec4595dby Marko Bencun+81−22 files
No security note in commit
Low 35 AI analysisMessage 50 · Thin
BB BitBoxBitBox02 firmware BitcoinHardware wallets

Merge remote-tracking branch 'agent/benma-agent/stage1-pairing-lifecycle'

This update fixes a Bluetooth pairing bug in the BitBox02 Nova hardware wallet. When the device switched from Bluetooth back to USB mode, it could keep an old pairing request active. The fix clears that stale pairing state so the device do…

Clearing of stale Bluetooth pairing state on mode switchPairing code/request flag left set across BLE->USB transition before fixBluetooth pairing lifecycle change in bootloader startup path
1047430dby Marko Bencun+7−65 files
Vendor flagged security relevance
Low 47 AI analysisMessage 50 · Thin
BB BitBoxBitBox02 firmware BitcoinHardware wallets

Merge remote-tracking branch 'agent/benma-agent/silent-payment-constant-time-ecdh'

This commit changes how the BitBox02 hardware wallet computes a secret value used in Bitcoin silent payments. Previously, the device used a function that could leak timing information about the secret key through how long the calculation t…

Constant-time cryptographic operation addedVariable-time secret-key multiplication removedSide-channel hardening for silent payments
c1590222by Marko Bencun+21−122 files
No security note in commit
Moderate 59 AI analysisMessage 68 · Adequate
BB BitBoxBitBox02 firmware BitcoinHardware wallets

btc: use constant-time ECDH for silent payments

This commit hardens the BitBox02 hardware wallet's silent-payments feature against a side-channel attack. Previously, the device multiplied a secret key with a public key using a routine whose execution time could leak information about th…

Constant-time cryptographic operation introduced to replace variable-time secret-key multiplicationVariable-time scalar multiplication retained only on public operandsSilent payments private input key material (a_sum) no longer used in variable-time path
7e741cfdby benma's agent+21−122 files
Vendor flagged security relevance
Informational 15 AI analysisMessage 50 · Thin
BB BitBoxBitBox02 firmware BitcoinHardware wallets

Merge branch 'nickez-agent/pin-protobuf-generators'

This commit is a build-system and developer-environment change. It pins the protobuf compiler and related Python tools to specific versions via a project-managed Python virtual environment, instead of relying on whatever version a develope…

Pinning build tools to exact versions reduces non-determinism in generated codeMoves protobuf compiler from system/Docker-installed binary to a version-locked Python wheelNo changes to firmware, cryptography, authentication, or device protocol logic
d072b0f9by Niklas Dusenlund+107−6411 files
No security note in commit
Informational 15 AI analysisMessage 92 · Strong
BB BitBoxBitBox02 firmware BitcoinHardware wallets

build: prefer local protoc for Rust bindings

This commit changes the build script that generates Rust code from protobuf definitions. It makes the build prefer a specific local copy of the protobuf compiler (protoc) installed in the repository's virtual environment, rather than relyi…

de8be632by NickeZ Agent+4−01 file
No security note in commit
Informational 15 AI analysisMessage 80 · Strong
BB BitBoxBitBox02 firmware BitcoinHardware wallets

build: use IPv4 for container downloads

This change forces the build system to use IPv4 instead of IPv6 when downloading tools and software packages during Docker image creation. It is a build reliability fix for GitHub Actions CI runners that lack IPv6 connectivity, not a secur…

bc434dcfby NickeZ Agent+6−41 file
No security note in commit
Informational 15 AI analysisMessage 80 · Strong
BB BitBoxBitBox02 firmware BitcoinHardware wallets

build: check regenerated protobuf bindings

This change improves a build/CI script that checks whether automatically generated protobuf binding files are up to date. It now also checks Python bindings and deletes old generated files before regenerating them, so stale files cannot hi…

No security-relevant code changeBuild/CI hardening onlyNo vulnerability fix or exploit mitigation present in diff
ff3f7474by NickeZ Agent+13−22 files
No security note in commit
Informational 15 AI analysisMessage 45 · Thin
BB BitBoxBitBox02 firmware BitcoinHardware wallets

Merge branch 'translate-passphrase-on-host'

This commit is a localization (translation) update for the BitBox02 hardware wallet. It replaces hard-coded English text strings in the passphrase unlock feature with calls to the device's internationalization system, so the same messages …

4dfa26b4by Marko Bencun+33−103 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 candidateMerge branch 'nickez-agent/locked-devdevice'by Niklas Dusenlund · 8ec7034c · Oct 28, 2026 · 16 filesMessage 45 · ThinLow 37Details
Commit message · Niklas Dusenlund

Merge branch 'nickez-agent/locked-devdevice'

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
Why it was queued
boot or update pathmerge-commit duplicate discount
AI analysis · Low 37/100

This commit reworks how BitBox02/Nova bootloader images are built, adding two new build flags: LOCKED (which enables hardware debug protection and boot protection) and DEVELOPMENT (which controls whether unsigned firmware images are accepted). It also renames the old 'devdevice' terminology to 'development' across scripts and tests. The change is primarily a build-system and naming refactor that introduces a new 'locked development' variant. It is not a patch for an active security vulnerability, but it touches security-relevant bootloader behavior, so care is needed that the wrong combination of flags cannot be accidentally produced or flashed.

Security candidatebuild: support locked development bootloadersby NickeZ Agent · f7009522 · Oct 28, 2026 · 16 filesMessage 85 · StrongLow 34Details
Commit message · NickeZ Agent

build: support locked development bootloaders

Hardware locking was tied to production mode, so development bootloaders
could not enable debug and boot protection while accepting unsigned
images.

Add saved LOCKED and DEVELOPMENT options for BitBox02 and Nova. LOCKED
controls hardware protection; DEVELOPMENT controls signature enforcement
and development markers. Keep unlocked development as the default,
support locked development, and require LOCKED=yes when DEVELOPMENT=no.
BitBox03 continues to accept only the default modes.

Select stage0/stage1 build and probe images from configuration, replacing
the top-level production/development stage aggregates. Preserve existing
artifact names and add development-locked variants. Refresh CMake target
definitions on each build and extend CI to build locked development
bootloaders for both products and stages.

Use BOOTLOADER_DEVELOPMENT in both stages and expose is_development() in
the Python client, retaining is_devdevice() as a deprecated alias. Keep
on-device flags and bundled bootloader images unchanged.

85/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context✓ Names security-relevant behavior explicitly
Why it was queued
signing boundaryupdate trustboot or update path
AI analysis · Low 34/100

This commit rewrites how BitBox02/Nova bootloaders are built so that 'hardware locking' and 'development mode' become two independent settings. Previously, locking was only available in production builds. Now developers can build a bootloader that has hardware debug protection enabled while still allowing unsigned (development) firmware. The change also renames internal flags from 'devdevice/production' to 'development/locked', updates build scripts, CI, and the Python flashing tool, and adds tests. It is a build-system and naming refactor rather than a runtime vulnerability fix.

Security candidateMerge remote-tracking branch 'agent/benma-agent/stage0-install-auth'by Marko Bencun · c13776fb · Oct 27, 2026 · 13 filesMessage 55 · ThinHigh 72Details
Commit message · Marko Bencun

Merge remote-tracking branch 'agent/benma-agent/stage0-install-auth'

55/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Names security-relevant behavior explicitly! No meaningful explanatory body
Why it was queued
boot or update pathmerge-commit duplicate discount
AI analysis · High 72/100

This commit hardens the BitBox02 bootloader's stage0 code against fault-injection attacks during firmware updates. It adds a new authorization check that re-verifies the installed firmware image and ensures a glitch cannot trick the device into installing an older, invalid, or attacker-chosen update. The change also prevents the compiler from optimizing away safety checks. Pre-built stage0 bootloader binaries were regenerated, and unit tests were added for the new logic.

Security candidateMerge remote-tracking branch 'agent/benma-agent/translations'by Marko Bencun · e4356238 · Oct 26, 2026 · 90 filesMessage 50 · ThinInformational 24Details
Commit message · Marko Bencun

Merge remote-tracking branch 'agent/benma-agent/translations'

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
Why it was queued
cryptography-sensitive pathsigning or wallet pathboot or update pathauthentication pathmerge-commit duplicate discount
AI analysis · Informational 24/100

This commit adds German-language translations to the BitBox02 hardware wallet firmware. It introduces a new internationalization (i18n) system, stores the chosen UI language in device memory, exposes it via the device-info API, and lets the host change it. The change is large but mostly mechanical: replacing hard-coded English strings with translated equivalents. There is no direct evidence in the diff of a security vulnerability, but any broad UI-text change carries a small risk that a safety-critical warning could be rendered incorrectly or bypassed due to a translation/lookup bug.

Security candidatememory: disable NVM caches during programmingby benma's agent · 5b902dae · Oct 26, 2026 · 4 filesMessage 76 · AdequateModerate 57Details
Commit message · benma's agent

memory: disable NVM caches during programming

On SAMD51 revisions A and D, reading flash while loading the NVM page
buffer can return corrupt data. Our programming routines execute from
flash, so instruction fetches expose them to this erratum even when the
source buffer is in RAM.

Disable both NVMCTRL AHB line caches around explicit page-buffer writes,
following [Microchip's workaround](https://www.microchip.com/DS80000748#page=35)
(DS80000748T, section 2.14.1). Restore the saved controller settings after
programming completes. This covers normal flash and user-row writes,
including BOOTPROT and SmartEEPROM configuration. The BOOTPROT path
resets immediately after programming.

Keep the caches enabled for normal execution: disabling them permanently
stalls stage0 while ICM hashes stage1 directly from flash. Scoping the
workaround to programming also limits its execution-time and power impact.

The change applies to rebuilt firmware, bootloader and factory images.
Ordinary SmartEEPROM data writes are outside its scope.

Co-authored-by: NickeZ Agent <niklas+agent@bitbox.swiss>

76/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queued
update trustboot or update path
AI analysis · Moderate 57/100

This commit fixes a hardware erratum in the microcontroller used by the BitBox02 hardware wallet. When the device writes to its internal flash memory, a bug in certain chip revisions can corrupt data being read from flash at the same time—including the program instructions being fetched to run the write routine. The patch temporarily disables two flash caches only during programming, then restores them afterward. If left unpatched, this could in theory lead to corrupted firmware writes, fuses, or security-critical configuration bits, but the commit is a preventive fix rather than a confirmed exploited vulnerability.

Security candidateMerge remote-tracking branch 'agent/benma-agent/mpu-scratch-nonexecutable'by Marko Bencun · 3aac81c9 · Oct 26, 2026 · 1 fileMessage 50 · ThinModerate 57Details
Commit message · Marko Bencun

Merge remote-tracking branch 'agent/benma-agent/mpu-scratch-nonexecutable'

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
Why it was queued
boot or update pathmerge-commit duplicate discount
AI analysis · Moderate 57/100

This change adjusts how the bootloader configures memory protection for a storage area called 'appdata' on the BitBox02 hardware wallet. The patch appears to extend a protected region so it also covers 'scratch space' and SmartEEPROM, and keeps these areas marked as non-executable. The branch name suggests the intent was to make the scratch area non-executable, which is a hardening measure rather than a fix for an active attack. However, the change is small and the commit message gives no details, so it is difficult to be certain whether this closes a real security gap or is just defensive cleanup.

AI review queuedui: speed up BB02 text renderingby benma's agent · 75e0346e · Oct 26, 2026 · 3 filesMessage 68 · AdequateInformational 19Details
Commit message · benma's agent

ui: speed up BB02 text rendering

The LVGL font renderer repeatedly validates every character map,
resolves each glyph separately for width and drawing, and clears pixels
before painting their foreground. This extra work slows BitBox02
counters and animations whose progress depends on the frame rate.

Validate only the selected character map and reuse the glyph descriptor
when drawing. Render glyphs inside their character cell in one pass,
reading packed bitmap bytes sequentially and clearing the surrounding
margins. Keep the general renderer for glyphs that extend beyond their
cell. Use the selected font's line height for fallback positioning and
background clearing.

Treat tabs as one space in the font adapter and pass only the resolved
glyph and selected line height to the drawing function. Tabs now use the
space glyph and advance, including the visible mask glyph in password
fonts. Previously, tabs were blank with twice the space advance.

For the same centered text, "Confirm address", both the SH1107 and
SSD1312 screen drivers give identical instruction counts in this build
(emulated Cortex-M4 instructions, ARM GCC 15.2.1, -Os, LTO):

| Font | Before LVGL | Current LVGL | With optimizations |
| --- | ---: | ---: | ---: |
| regular_9 | 39,677 | 76,687 | 39,096 |
| regular_11 (default) | 49,033 | 87,809 | 47,757 |
| regular_12 | 66,522 | 104,584 | 62,895 |
| password_9 | 41,540 | 81,345 | 43,036 |
| password_12 | 69,005 | 110,131 | 67,464 |
| monogram_16 | 47,410 | 62,037 | 47,594 |

This brings instruction counts back to roughly the pre-LVGL level for
this sample (-5.5% to +3.6%). These are emulated instruction counts, not
hardware timings or frame rates; display transfers and other work in a
frame are excluded.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
defensive validationsecond-pass: broader security terminology
AI analysis · Informational 19/100

This commit is a performance optimization for drawing text on the BitBox02 hardware wallet screen. It makes text rendering faster by reducing repeated work and changing how tabs are displayed (now a single space width instead of double). The changes are accompanied by new unit tests. There is no clear security vulnerability here, but any change to low-level screen drawing code carries a small risk of visual glitches or unexpected behavior.

AI review queuedMerge remote-tracking branch 'agent/benma-agent/btc-prevtx-input-hash-length'by Marko Bencun · 8023d571 · Oct 22, 2026 · 1 fileMessage 50 · ThinModerate 59Details
Commit message · Marko Bencun

Merge remote-tracking branch 'agent/benma-agent/btc-prevtx-input-hash-length'

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
Why it was queued
signing or wallet pathmerge-commit duplicate discountsecond-pass: security-sensitive path
AI analysis · Moderate 59/100

This commit adds a safety check in the BitBox02 hardware wallet's Bitcoin transaction signing code. When the device processes a previous transaction supplied by the host computer, it now verifies that each input's previous-output hash is exactly 32 bytes long before using it. Without this check, a malformed or attacker-crafted hash of the wrong length could have been fed into the transaction hasher, potentially leading to incorrect transaction signatures or unexpected device behavior. The change is defensive and includes new tests covering hash lengths of 0, 31, and 33 bytes.

AI review queuedbtc: validate prevtx input hash lengthby benma's agent · 7ae83b0d · Oct 21, 2026 · 1 fileMessage 78 · AdequateModerate 59Details
Commit message · benma's agent

btc: validate prevtx input hash length

Previous transaction inputs were hashed without checking that their
previous output hashes were 32 bytes. This allowed malformed transaction
data to pass verification when the host supplied the matching transaction
hash.

Reject these inputs with InvalidInput before hashing their fields.

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
defensive validationsigning or wallet pathsecond-pass: near security thresholdsecond-pass: security-sensitive path
AI analysis · Moderate 59/100

This commit fixes a missing length check in the BitBox02 hardware wallet's Bitcoin transaction signing code. When verifying a previous transaction supplied by the host computer, the device was hashing the previous output hash without first confirming it was the expected 32 bytes. A malicious or buggy host could supply a shortened or lengthened hash that still matched a transaction hash the device itself computed, letting malformed data pass verification. The patch now rejects any hash that is not exactly 32 bytes before hashing it.

Security candidateMerge remote-tracking branch 'agent/benma-agent/stage0-randomness-backup'by Marko Bencun · 870bd953 · Oct 21, 2026 · 18 filesMessage 55 · ThinLow 46Details
Commit message · Marko Bencun

Merge remote-tracking branch 'agent/benma-agent/stage0-randomness-backup'

55/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Names security-relevant behavior explicitly! No meaningful explanatory body
Why it was queued
boot or update pathmerge-commit duplicate discount
AI analysis · Low 46/100

This commit updates the BitBox02 hardware wallet's earliest boot code (stage0 bootloader) to version 3. The main change moves a backup copy of the factory-generated randomness out of the main firmware flash area and into a dedicated scratch region. Previously, that backup sat inside the firmware update area, so a firmware update could accidentally overwrite or corrupt it. The change is a defensive hardening fix: it preserves a secret used during bootloader updates and reduces the chance that a firmware update could break the device's ability to update the bootloader or boot securely.

Security candidatestage0: name backup block as shared scratch spaceby benma's agent · e3811c4c · Oct 20, 2026 · 5 filesMessage 85 · StrongInformational 15Details
Commit message · benma's agent

stage0: name backup block as shared scratch space

The backup block can also hold temporary data for stage1 and firmware,
but its factory-randomness name suggests dedicated storage.

Expose the region as shared flash scratch space and keep the backup
record specific to stage0. Document that contents may not survive a
reboot because stage0 overwrites the space during stage1 updates.

Check the stage1 update slot against the appdata boundary so it remains
inside the firmware area. The flash layout and runtime behavior are
unchanged.

85/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Names security-relevant behavior explicitly
Why it was queued
boot or update path
AI analysis · Informational 15/100

This commit is a code cleanup and documentation change in the BitBox02 bootloader. It renames a flash memory region from 'factory randomness backup' to 'shared scratch space' because the same area can be used for temporary data by other bootloader stages. The actual memory layout and runtime behavior are explicitly stated to be unchanged. A new compile-time check is added to ensure the stage1 update area stays within the firmware region.

Security candidatestage0: move randomness backup out of firmwareby benma's agent · eff45631 · Oct 20, 2026 · 17 filesMessage 73 · AdequateLow 33Details
Commit message · benma's agent

stage0: move randomness backup out of firmware

Stage0 stores its factory randomness backup in the firmware area. Writing
that backup changes the signed firmware bytes during a stage1 update,
preventing a firmware image from carrying the update and remaining bootable
afterward.

Move the backup to the unused 8 KiB erase block at 0xFA000, between bootdata
and SmartEEPROM. Preserve the existing committed-backup recovery mechanism
and enforce the new memory boundaries. This allows future firmware images
to include a stage1 update without the backup invalidating their signatures.

Bump stage0 to v3 and embed rebuilt production and development images in
blupgrade. Reclaim the former backup reservation and adjacent padding for
blupgrade code/data, and document the flash layout and stage0 releases.

Devices need stage0 v3 before relying on the new backup location.

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
signing boundaryboot or update path
AI analysis · Low 33/100

This commit fixes a bootloader/firmware layout bug. Previously, a secret factory randomness backup was stored inside the signed firmware area. When stage1 updated that backup, it changed bytes in the firmware image, breaking the cryptographic signature and making the device unbootable. The patch moves the backup to a separate, unused flash region, adds boundary checks, and ships rebuilt bootloader stage0 v3 images. It is a reliability and integrity improvement rather than a direct remote exploit.

Security candidatebtc: use secp256k1 keys in wallet policiesby benma's agent · 662809bd · Oct 19, 2026 · 1 fileMessage 68 · AdequateInformational 19Details
Commit message · benma's agent

btc: use secp256k1 keys in wallet policies

Derived wallet-policy keys always come from compressed BIP32 xpubs. Use
secp256k1::PublicKey for these keys to save 1,280 bytes in the BitBox02
multi firmware, reducing firmware.bin from 638,492 to 637,212 bytes.

bitcoin::PublicKey carries a compression flag and supports both compressed
and uncompressed encodings. Miniscript already supports secp256k1::PublicKey
and treats it as compressed, so the compiler can eliminate unnecessary
compression checks during policy derivation and script construction.

The simpler type also uses a different Display implementation. This removes
the general-purpose hex formatter retained by bitcoin::PublicKey for
Miniscript's error messages, even though the firmware discards that error
text and returns its own error codes.

Key values, serialized scripts, addresses and Taproot spend data remain
unchanged. Update the serialization calls to use the key directly.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
secret or key material
AI analysis · Informational 19/100

This is a code cleanup and memory-optimization change in the BitBox02 Bitcoin wallet firmware. It swaps a more flexible public-key type for a simpler, always-compressed one inside wallet policy handling. The commit explicitly states that serialized scripts, addresses, and Taproot data stay the same, and the main benefit is a 1,280-byte smaller firmware image. There is no direct evidence of a security vulnerability being fixed.

AI review queuedMerge remote-tracking branch 'agent/benma-agent/unstable-key-sorting'by Marko Bencun · ae548ef4 · Oct 19, 2026 · 2 filesMessage 50 · ThinInformational 24Details
Commit message · Marko Bencun

Merge remote-tracking branch 'agent/benma-agent/unstable-key-sorting'

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
Why it was queued
signing or wallet pathmerge-commit duplicate discountsecond-pass: security-sensitive path
AI analysis · Informational 24/100

This commit replaces Rust's stable sort with an unstable sort in three places inside the BitBox02 firmware. Stable and unstable sorts produce the same output when all items are different, but can differ when there are duplicate items. In two places (multisig xpub hashing and pkscript building), the sorted data is hashed or turned into a Bitcoin script, so any change in ordering could change the resulting wallet fingerprint or transaction address. In the third place (Cardano signing keypaths), the list is deduplicated right after sorting, so duplicates are removed anyway. The change is likely intended to save a small amount of memory or runtime, but it is a partial patch: the commit message gives no explanation, and there is no visible follow-up to ensure callers never rely on stability for duplicate entries.

AI review queuedMerge remote-tracking branch 'agent/benma-agent/compact-biguint'by Marko Bencun · 8e6b0760 · Oct 19, 2026 · 4 filesMessage 50 · ThinInformational 19Details
Commit message · Marko Bencun

Merge remote-tracking branch 'agent/benma-agent/compact-biguint'

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
Why it was queued
signing or wallet pathmerge-commit duplicate discountsecond-pass: security-sensitive path
AI analysis · Informational 19/100

This commit is a code-size optimization, not a security fix. It replaces generic num-bigint decimal formatting and multiplication/division routines in the Ethereum signing code with smaller, hand-written scalar versions. The goal is to reduce the firmware binary size by avoiding large arithmetic helpers. A new CI check was added to prevent these heavy symbols from creeping back in. There is no evidence in the commit of a vulnerability, exploit, or security incident.

AI review queuedMerge remote-tracking branch 'agent/benma-agent/fee-percentage-rounding'by Marko Bencun · d15c46b3 · Oct 19, 2026 · 2 filesMessage 50 · ThinInformational 21Details
Commit message · Marko Bencun

Merge remote-tracking branch 'agent/benma-agent/fee-percentage-rounding'

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
Why it was queued
signing or wallet pathmerge-commit duplicate discountsecond-pass: security-sensitive path
AI analysis · Informational 21/100

This commit fixes how the BitBox02 hardware wallet rounds a fee percentage shown on screen. The old code used a standard floating-point rounding function that could produce wrong results for values very close to a rounding boundary, and it also added unwanted floating-point code to the firmware binary. The new code does the rounding with integer arithmetic and clamps out-of-range or invalid inputs. The visible effect is a slightly different displayed fee percentage in edge cases; there is no direct evidence this could be used to steal funds or run unauthorized code.

AI review queuedMerge remote-tracking branch 'agent/benma-agent/compact-erc20-storage'by Marko Bencun · 69660056 · Oct 19, 2026 · 5 filesMessage 50 · ThinInformational 17Details
Commit message · Marko Bencun

Merge remote-tracking branch 'agent/benma-agent/compact-erc20-storage'

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
Why it was queued
signing or wallet pathmerge-commit duplicate discountsecond-pass: security-sensitive path
AI analysis · Informational 17/100

This commit is a code-size optimization for how the BitBox02 hardware wallet stores ERC-20 token metadata (token symbols, decimals, and contract addresses). It replaces a simpler but larger table with a compact, bit-packed lookup table generated at build time. There is no direct evidence in the commit that this fixes a security bug; it appears to be a firmware-size reduction refactor. The only user-visible code change is switching from a static string reference to an owned String for the token unit, which is a consequence of the new packed storage format.

Security candidateapi: use unstable sorting for keysby benma's agent · 377cf9f1 · Oct 15, 2026 · 2 filesMessage 68 · AdequateInformational 19Details
Commit message · benma's agent

api: use unstable sorting for keys

Stable sorting is unnecessary for these keys and adds sorting code to the
firmware. Using sort_unstable() saves 832 bytes in the BitBox02 multi
firmware with Rust 1.96.0, reducing firmware.bin from 661,896 to 661,064
bytes.

Sort serialized multisig xpubs, derived public keys, and Cardano signing
paths with the same lexicographic ordering. Equal values have identical
contents, so changing their relative order cannot affect registration
hashes, output scripts, or witness order. Cardano still removes duplicate
paths after sorting.

The unstable sort also avoids the stable sort's possible temporary
allocation.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
signing boundarysigning or wallet path
AI analysis · Informational 19/100

This commit swaps Rust's stable sort for an unstable sort in three places inside the BitBox02 firmware. The change only affects the order in which equal items are arranged, and the commit message explicitly states that equal items have identical contents, so the result is the same. The main benefit is a smaller firmware file and avoiding a possible memory allocation during sorting. There is no direct evidence this fixes a security vulnerability.

AI review queuedeth: reduce big-integer code sizeby benma's agent · 05e80656 · Oct 15, 2026 · 3 filesMessage 68 · AdequateInformational 12Details
Commit message · benma's agent

eth: reduce big-integer code size

Generic num-bigint formatting and multiplication retain routines for much
larger integers than Ethereum needs. Avoiding those routines saves 6,420
bytes in BitBox02 multi firmware, reducing it from 661,912 to 655,492 bytes
without changing dependencies.

Convert decimal digits with division and remainder by 10u32. Use this for
amount formatting and EIP-712 integer text, preserving the sign of signed
values. Calculate transaction fees by consuming the gas-limit bytes from
most to least significant, using shifts, scalar products, and additions.
Both changes are needed to remove the general multiplication routines,
which generic decimal conversion also uses.

Keep arbitrary-precision arithmetic, input validation, decimal placement,
trimming, and EIP-712 sign extension unchanged. The scalar loops favor
code size and can perform more iterations and temporary allocations.

Add the eliminated formatting, multiplication, and division symbols to the
firmware CI check so future call sites cannot silently bring them back.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
signing or wallet pathsecond-pass: security-sensitive path
AI analysis · Informational 12/100

This commit is a code-size optimization for the BitBox02 hardware wallet firmware. It replaces generic big-integer formatting and multiplication with smaller, hand-written scalar loops specifically sized for Ethereum's needs. There is no security fix or vulnerability being patched; the goal is to reduce firmware size by about 6,420 bytes while keeping the same arithmetic results.

AI review queuedeth: cover large-number formatting and feesby benma's agent · c1375689 · Oct 15, 2026 · 2 filesMessage 78 · AdequateInformational 12Details
Commit message · benma's agent

eth: cover large-number formatting and fees

Add focused regression cases before changing large-number formatting and
fee calculations to reduce firmware size.

Compare the signed and unsigned decimal helpers directly with
num-bigint's formatting. Cover zero, digit boundaries, embedded and
trailing zeroes, large unsigned values, a 257-bit transaction total, and
negative values through the minimum signed 256-bit value.

Compare both fee formulas with direct BigUint multiplication using zero,
one, mixed bytes, and maximum inputs. Keep these cases separate from the
implementation change so they apply to both versions.

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
signing or wallet pathsecond-pass: security-sensitive path
AI analysis · Informational 12/100

This commit only adds new automated tests for Ethereum fee calculation and large-number decimal formatting. It does not change any production code, so it cannot by itself introduce or fix a security bug. The tests are described by the author as regression tests to prepare for a future formatting and fee-calculation change that aims to reduce firmware size.

AI review queuedutil: extract big-integer decimal formattingby benma's agent · 9e999101 · Oct 15, 2026 · 2 filesMessage 78 · AdequateInformational 19Details
Commit message · benma's agent

util: extract big-integer decimal formatting

Give signed and unsigned integer-to-text conversion dedicated entry
points so it can be tested directly, separately from amount formatting
and EIP-712 message encoding.

Route existing callers through bigint_to_string() and
biguint_to_string(). Both helpers still delegate to num-bigint's
to_string(), preserving the existing behavior.

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
signing or wallet pathsecond-pass: security-sensitive path
AI analysis · Informational 19/100

This commit is a straightforward code cleanup: it pulls out existing big-number-to-text conversion into named helper functions so they can be tested directly. The actual behavior is unchanged because the new helpers still call the same underlying library method (num-bigint's to_string()). There is no security fix or vulnerability here.

Security candidateMerge branch 'benma-agent/prost-size-update'by Marko Bencun · 2b082e10 · Oct 15, 2026 · 89 filesMessage 45 · ThinInformational 24Details
Commit message · Marko Bencun

Merge branch 'benma-agent/prost-size-update'

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

This commit is a large dependency update for the BitBox02 firmware, primarily updating the vendored Rust 'prost' protobuf library and related crates. It removes old vendored copies of 'concurrent-queue' and 'crossbeam-utils' and updates generated protobuf code. The commit itself does not describe any security fix, and the visible diff does not show a clear, exploitable vulnerability. It appears to be routine maintenance to keep dependencies current and reduce vendored code size.

Security candidateMerge remote-tracking branch 'agent/benma-agent/factory-context-size-comment'by Marko Bencun · e34efd26 · Oct 13, 2026 · 1 fileMessage 50 · ThinInformational 15Details
Commit message · Marko Bencun

Merge remote-tracking branch 'agent/benma-agent/factory-context-size-comment'

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
Why it was queued
cryptography-sensitive pathmerge-commit duplicate discount
AI analysis · Informational 15/100

This commit only updates a code comment to correct the stated memory savings from using a static secp256k1 verification context. No actual code behavior, logic, or security properties changed. It is a documentation-only fix.

Security candidateMerge remote-tracking branch 'agent/benma-agent/secp256k1-randomize'by Marko Bencun · 04f37f80 · Oct 13, 2026 · 8 filesMessage 50 · ThinLow 45Details
Commit message · Marko Bencun

Merge remote-tracking branch 'agent/benma-agent/secp256k1-randomize'

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
Why it was queued
cryptography-sensitive pathboot or update pathmerge-commit duplicate discount
AI analysis · Low 45/100

This commit changes how the BitBox02 hardware wallet initializes the secp256k1 cryptographic library. Previously, the library's global context was created automatically on first use. Now, it must be explicitly initialized with a random 32-byte seed before use. The seed is used to randomize internal computations, which is a standard side-channel defense. If the context is used before initialization, the firmware will panic (crash). The change also adds test-only fallbacks so existing tests still work without providing a seed.

Security candidatefactorysetup: update context savings commentby benma's agent · c7b395df · Oct 13, 2026 · 1 fileMessage 68 · AdequateInformational 15Details
Commit message · benma's agent

factorysetup: update context savings comment

The 35 kB estimate predates the secp256k1 upgrade and switch to the
2 KiB signing table. Update it to roughly 6.5 kB; this changes only
the comment.

With the current library and table settings, restoring the Rust
context used before 2756aca4 produces a 165,644-byte factory-setup.bin,
compared with 159,164 bytes using the static context: a saving of
6,480 bytes (6.33 KiB).

The static context avoids the 2,048-byte signing table plus 4,432
bytes of context initialization/support code and other linked data.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
signing boundarycryptography-sensitive path
AI analysis · Informational 15/100

This commit only updates a code comment to correct the estimated memory savings from using a static cryptographic context. No actual code behavior, logic, or security properties were changed.