LD
← All projectsLedger

Ledger Bitcoin app

Open-source Bitcoin application running on Ledger devices; the device OS is outside this repository.

BitcoinHardware walletsNormal
Repository coverage

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

148security candidates154second-pass queue402AI analyses
19commits · 30 days
63commits · 60 days
249commits · 180 days
414commits · 365 days
Backfill bands
Aug 5 → Feb 670 seen8 candidatesComplete
Feb 6 → Jun 6149 seen21 candidatesComplete
Jun 6 → Jul 623 seen0 candidatesComplete
Jul 6 → Aug 555 seen5 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.

57/100 average clarity
50Strong · 80–100
152Adequate · 60–79
186Thin · 40–59
59Opaque · 0–39
6security 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.
Salvatore Ingala2981122561062
Ilya Artemov962696145
Ruben Waterman666083
Aymeric Robert434063
github-actions[bot]17117046
Mathias BROUSSET17015039
José Luis Landabaso Díaz404067
iartemov-ledger201051
Cerberus Merlin101062
Michael Evans101073
Charles-Edouard de la Vergne101045
Analysis record

Published AI watches

Last scanned 48 minutes ago

Informational 20 AI analysisMessage 83 · Strong
LD LedgerLedger Bitcoin app BitcoinHardware wallets

tests: pin all Python test dependencies to exact versions

This commit pins the exact versions of Python testing tools used by the project's automated tests. Previously, the test setup allowed any newly released version of those tools to be installed automatically, which could introduce unexpected…

Supply-chain risk reduction for test/CI dependenciesPrevents unreviewed automatic upgrades of speculos and raggerNo change to firmware or published package code
def417a3by Salvatore Ingala+329−142 files
No security note in commit
Informational 15 AI analysisMessage 38 · Opaque
LD LedgerLedger Bitcoin app BitcoinHardware wallets

Bump version to 2.6.0

This commit is a routine version bump from 2.5.1 to 2.6.0 in the Ledger Bitcoin app. It only updates the version number in the Makefile and the release date in the CHANGELOG. There are no code changes, no bug fixes, and no security-related…

2b424b54by Salvatore Ingala+4−42 files
No security note in commit
Moderate 66 AI analysisMessage 68 · Adequate
LD LedgerLedger Bitcoin app BitcoinHardware wallets

Merge pull request #581 from LedgerHQ/client-fixes

This commit tightens how the Ledger Bitcoin app and its companion client libraries read PSBT (Partially Signed Bitcoin Transaction) data. It adds checks that reject malformed or suspicious PSBTs: truncated fields, unexpected extra bytes af…

Hardened PSBT deserialization against truncation and trailing dataAdded duplicate-key detection in PSBT mapsRejected PSBTv2-only fields inside PSBTv0 to prevent locktime/field override attacks
f8f790a3by Salvatore Ingala+544−17018 files
No security note in commit
Low 47 AI analysisMessage 73 · Adequate
LD LedgerLedger Bitcoin app BitcoinHardware wallets

python client: reject PSBTv2-only fields in a PSBTv0

This commit tightens input validation in the Python helper library that prepares Bitcoin transaction data for Ledger hardware wallets. It now rejects PSBT files that claim to be the older version 0 format but contain fields that only belon…

Input-validation hardening: stricter parsing of PSBT version 0 to reject v2-only key typesConsistency fix across clients: aligns Python client with HS and Rust client behaviorLocktime normalization during v0-to-v2 conversion to prevent per-input locktime from overriding transaction locktime
84165be7by Salvatore Ingala+92−02 files
No security note in commit
Informational 24 AI analysisMessage 83 · Strong
LD LedgerLedger Bitcoin app BitcoinHardware wallets

tests: update authproxy.py to the latest version from Bitcoin Core

This commit updates a test helper file used to talk to a Bitcoin node during automated testing. The old helper could accidentally send the same command twice if the network connection hiccuped, which could cause a test-only action like sen…

Removed transparent retry of non-idempotent RPC requests after connection resetsTest helper could execute state-changing RPCs twice before the fixNew connection-per-call configuration mitigates idle-timeout disconnects without retry risk
c7ca508eby Salvatore Ingala+91−522 files
Vendor flagged security relevance
Low 40 AI analysisMessage 65 · Adequate
LD LedgerLedger Bitcoin app BitcoinHardware wallets

Reject duplicate keys and trailing data when parsing a PSBT in the JS client

This commit fixes the JavaScript PSBT (Partially Signed Bitcoin Transaction) parser in Ledger's Bitcoin app so it now rejects malformed PSBTs that contain duplicate keys or extra trailing bytes. Previously, such malformed data could be acc…

BIP-174 non-compliance: duplicate keys and trailing data were previously acceptedState reuse bug: deserializing multiple PSBTs in the same instance could merge mapsInput validation gap in client-side PSBT parsing
4942a4aeby Salvatore Ingala+40−02 files
No security note in commit
Informational 15 AI analysisMessage 73 · Adequate
LD LedgerLedger Bitcoin app BitcoinHardware wallets

ragger: fail if a request succeeds without showing the expected screens

This commit fixes the automated test harness, not the Ledger Bitcoin app itself. Previously, the test framework could silently pass even when the device completed a request without showing the expected on-screen review. The change makes te…

Test-hardening only: no firmware or runtime application code changedFixes false-negative test results where a request could succeed without expected UI reviewCorrects scope of navigation settings to avoid leaking across nested or subsequent calls
202d352aby Salvatore Ingala+76−957 files
No security note in commit
Low 37 AI analysisMessage 88 · Strong
LD LedgerLedger Bitcoin app BitcoinHardware wallets

unit tests: Fix length overflow in unit-test PSBT parser

This commit fixes an arithmetic overflow bug in a test-only PSBT (Bitcoin transaction format) parser used in unit tests. The bug could let a crafted test input make the parser think a data length is huge, potentially confusing the mock dis…

Integer overflow/wrap-around in length calculationOut-of-bounds length derived from arithmetic on attacker-influenced offsetsUnit-test-only code path, not device firmware
6a2a9262by Salvatore Ingala+6−21 file
No security note in commit
Low 48 AI analysisMessage 73 · Adequate
LD LedgerLedger Bitcoin app BitcoinHardware wallets

rust client: reject PSBTv2-only fields when converting a PSBTv0

This commit fixes a bug in the Ledger Bitcoin app's Rust client where a PSBT v0 (an older transaction format) could silently carry fields that only have meaning in PSBT v2. When converting v0 to v2, those fields could override values taken…

Input validation added for cross-format PSBT conversionPrevents v2-only fields from overriding unsigned-transaction-derived valuesBIP-370 compliance enforcement for PSBTv0
602055d6by Salvatore Ingala+66−91 file
No security note in commit
Moderate 51 AI analysisMessage 73 · Adequate
LD LedgerLedger Bitcoin app BitcoinHardware wallets

Reject PSBTv2-only fields when converting a PSBTv0 in the JS client

This commit fixes a bug in the Ledger Bitcoin app's JavaScript client library. When converting an older-style Bitcoin transaction file (PSBT version 0) into the newer PSBT version 2 format, the library previously ignored fields that are on…

Input validation fix: rejects malformed PSBTv0 containing v2-only fieldsPrevents silent override of transaction locktime during PSBTv0-to-v2 conversionAdds missing BIP-370 key type constants for required time/height locktime
a1f6dc84by Salvatore Ingala+66−22 files
No security note in commit
High 72 AI analysisMessage 73 · Adequate
LD LedgerLedger Bitcoin app BitcoinHardware wallets

Reject duplicate keys and truncated maps when parsing PSBT maps in sign_psbt

This commit fixes a bug in how the Ledger Bitcoin app client parses PSBT (Partially Signed Bitcoin Transaction) maps. Previously, if the same key appeared twice in a map, the parser silently kept the last value. A malicious or malformed PS…

Silent overwrite of duplicate PSBT map keys could create commitment mismatch between client and deviceTruncated PSBT maps were silently accepted due to exception swallowing in deserialization loopsTrailing data after PSBT maps was ignored, allowing reserialization to silently normalize malformed inputs
75df80f9by Salvatore Ingala+107−104 files
Vendor flagged security relevance
High 72 AI analysisMessage 53 · Thin
LD LedgerLedger Bitcoin app BitcoinHardware wallets

Merge pull request #579 from LedgerHQ/misc-fixes

This commit fixes several bugs in Ledger's Bitcoin app. The most serious ones are: (1) a set of miniscript policy analyzer mistakes that could let the app accept Bitcoin wallet policies whose scripts are too large or too expensive to execu…

Miniscript cost/property analysis errors that could allow oversized/undercosted wallet policiesHost-driven infinite-loop / denial-of-service via zero-length GET_MORE_ELEMENTS responsesUI state inconsistency causing a security warning to be prematurely dismissed
ec389348by Salvatore Ingala+413−3113 files
No security note in commit
Low 26 AI analysisMessage 73 · Adequate
LD LedgerLedger Bitcoin app BitcoinHardware wallets

Merge pull request #576 from LedgerHQ/musig2_improvements

This commit improves the Ledger Bitcoin app's MuSig2 multi-signature feature. It lets wallet software pre-generate public nonces before a transaction is known, adds an optional MUSIG2_SESSION_ID field so multiple signing sessions can be in…

New PSBT proprietary field parsing with length validation (1-32 bytes, empty rejected)Session ID now commits to wallet policy plus optional MUSIG2_SESSION_IDSession storage limit raised from 8 to 32 with LRU eviction
26d22adcby Salvatore Ingala+710−7216 files
No security note in commit
Informational 18 AI analysisMessage 85 · Strong
LD LedgerLedger Bitcoin app BitcoinHardware wallets

Use signed scratch arrays in the thresh ops and stack size computations

This commit is a small code cleanup in Ledger's Bitcoin app. It changes two local arrays from unsigned (uint16_t) to signed (int16_t) in functions that count operations and stack sizes for Bitcoin miniscript 'thresh' policies. The commit m…

Signed/unsigned type mismatch in sentinel handlingPotential latent integer interpretation bug in miniscript threshold policy analysisCode clarity improvement around invalid (dis)satisfaction markers
4ff6f2f0by Salvatore Ingala+4−41 file
No security note in commit
Low 48 AI analysisMessage 91 · Strong
LD LedgerLedger Bitcoin app BitcoinHardware wallets

Align miniscript type and ops computations with bitcoin-core

This commit fixes the Ledger Bitcoin app's internal checker for Miniscript wallet policies. The checker was incorrectly rejecting some valid Bitcoin spending policies as unsafe, and in a few places it was computing safety properties using …

Logic change in Miniscript policy analysisAlignment with upstream Bitcoin Core reference implementationRelaxation of overly strict non-malleability and timelock-mixing checks
4694d317by Salvatore Ingala+26−132 files
No security note in commit
Moderate 68 AI analysisMessage 86 · Strong
LD LedgerLedger Bitcoin app BitcoinHardware wallets

Fix ops computation for andor fragments

This commit fixes a bug in how the Ledger Bitcoin app counts the number of Bitcoin script operations (ops) needed to spend certain wallet policies that use a 'miniscript andor' fragment. Because the count was wrong, the app could allow use…

Incorrect miniscript ops accounting for andor fragmentPolicy sanity check bypass leading to unspendable registered walletsReference alignment with Bitcoin Core implementation
86159d1eby Salvatore Ingala+40−13 files
Vendor flagged security relevance
High 74 AI analysisMessage 78 · Adequate
LD LedgerLedger Bitcoin app BitcoinHardware wallets

Fix ops computation for l: and u: fragments

This commit fixes a bug in how the Ledger Bitcoin app counts Bitcoin script operations ('ops') for two specific Miniscript fragments, 'l:' and 'u:'. Because the count was too low, the app could accept wallet policies that look valid but ar…

Undercounting of script operation budget leading to acceptance of unspendable policiesIncorrect handling of Miniscript wrapper dissatisfaction semanticsPolicy sanity check bypass via operation-count accounting flaw
b6ac1de8by Salvatore Ingala+39−33 files
Vendor flagged security relevance
Informational 15 AI analysisMessage 68 · Adequate
LD LedgerLedger Bitcoin app BitcoinHardware wallets

doc: document the MUSIG2_SESSION_ID PSBT field

This commit only updates documentation and the changelog. It explains a new optional PSBT field called MUSIG2_SESSION_ID that lets software wallets manage multiple MuSig2 signing sessions for the same wallet policy on a Ledger device. Ther…

8d8ed9afby Salvatore Ingala+28−62 files
No security note in commit
Informational 15 AI analysisMessage 78 · Adequate
LD LedgerLedger Bitcoin app BitcoinHardware wallets

musig_sessions: store up to 32 sessions

This commit is a simple capacity increase, not a security fix. It raises the number of simultaneous MuSig2 signing sessions the Ledger Bitcoin app can keep in memory from 8 to 32, because users with multiple MuSig accounts or wallets that …

a6798172by Salvatore Ingala+12−54 files
No security note in commit
Low 26 AI analysisMessage 73 · Adequate
LD LedgerLedger Bitcoin app BitcoinHardware wallets

sign_psbt: fail before the UI if the MuSig2 session is missing

This commit improves the user experience and error handling for Ledger's Bitcoin app when using MuSig2 multi-signatures. Previously, if a required MuSig2 session was missing during the second round of signing, the device would only report …

UX-hardening: fail-fast before user approval instead of afterNew specific error code EC_SIGN_PSBT_MUSIG2_SESSION_NOT_FOUND for missing MuSig2 sessionsRefactored session storage lookup to support non-destructive existence check
2d04b144by Salvatore Ingala+118−187 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.

AI review queuedBump version to 2.6.0by Salvatore Ingala · 2b424b54 · Nov 5, 2026 · 2 filesMessage 38 · OpaqueInformational 15Details
Commit message · Salvatore Ingala

Bump version to 2.6.0

38/100 · OpaqueMessage clarity
✓ Subject identifies a change✓ Names a concrete action or component! No meaningful explanatory body
Why it was queued
second-pass: opaque commit message
AI analysis · Informational 15/100

This commit is a routine version bump from 2.5.1 to 2.6.0 in the Ledger Bitcoin app. It only updates the version number in the Makefile and the release date in the CHANGELOG. There are no code changes, no bug fixes, and no security-related modifications in the diff itself.

AI review queuedMerge pull request #579 from LedgerHQ/misc-fixesby Salvatore Ingala · ec389348 · Nov 2, 2026 · 13 filesMessage 53 · ThinHigh 72Details
Commit message · Salvatore Ingala

Merge pull request #579 from LedgerHQ/misc-fixes

Miscellaneous improvements

53/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Links an issue, advisory, or supporting reference! No meaningful explanatory body
Why it was queued
signing or wallet pathmerge-commit duplicate discountsecond-pass: security-sensitive path
AI analysis · High 72/100

This commit fixes several bugs in Ledger's Bitcoin app. The most serious ones are: (1) a set of miniscript policy analyzer mistakes that could let the app accept Bitcoin wallet policies whose scripts are too large or too expensive to execute safely, and (2) a denial-of-service issue where a malicious computer app could keep the Ledger stuck in a slow loop forever by sending empty data chunks. It also fixes a UI glitch where a warning screen could be accidentally cleared by the next command.

AI review queuedMerge pull request #576 from LedgerHQ/musig2_improvementsby Salvatore Ingala · 26d22adc · Oct 23, 2026 · 16 filesMessage 73 · AdequateLow 26Details
Commit message · Salvatore Ingala

Merge pull request #576 from LedgerHQ/musig2_improvements

MuSig2 improvements for pre-generating nonces

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Links an issue, advisory, or supporting reference
Why it was queued
signing or wallet pathmerge-commit duplicate discountsecond-pass: security-sensitive path
AI analysis · Low 26/100

This commit improves the Ledger Bitcoin app's MuSig2 multi-signature feature. It lets wallet software pre-generate public nonces before a transaction is known, adds an optional MUSIG2_SESSION_ID field so multiple signing sessions can be in flight for the same wallet, and increases the stored session limit from 8 to 32. It also adds early checks so the device fails fast if a Round 2 session is missing, and rejects malformed session IDs. The changes are defensive and do not appear to introduce a vulnerability.

AI review queuedUse signed scratch arrays in the thresh ops and stack size computationsby Salvatore Ingala · 4ff6f2f0 · Oct 22, 2026 · 1 fileMessage 85 · StrongInformational 18Details
Commit message · Salvatore Ingala

Use signed scratch arrays in the thresh ops and stack size computations

sumcheck() and maxcheck() return -1 for invalid (dis)satisfactions,
which was stored in uint16_t arrays; this wasn't a bug only because it
is later converted back to -1 when read as int16_t.

Using int16_t directly is clearer.

85/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
Why it was queued
signing or wallet pathsecond-pass: security-sensitive path
AI analysis · Informational 18/100

This commit is a small code cleanup in Ledger's Bitcoin app. It changes two local arrays from unsigned (uint16_t) to signed (int16_t) in functions that count operations and stack sizes for Bitcoin miniscript 'thresh' policies. The commit message says the old code was not actually buggy because the stored -1 values were later read back as signed -1 anyway, but using signed types directly is clearer and less error-prone.

AI review queuedAlign miniscript type and ops computations with bitcoin-coreby Salvatore Ingala · 4694d317 · Oct 22, 2026 · 2 filesMessage 91 · StrongLow 48Details
Commit message · Salvatore Ingala

Align miniscript type and ops computations with bitcoin-core

Fixes several discrepancies, all making the analysis stricter than
necessary, which could cause valid policies to be rejected:

- and_n(X,Y) is andor(X,Y,0): since 0 has the 's' property, non-
malleability does not require s_X or s_Y; and the dissatisfaction
of Y is never executed, so it does not contribute to the ops count.
- thresh: the timelock mixing check compared each child with the
accumulated timelocks including its own, so a child with different
kinds of timelocks in separate branches was flagged as mixing.

Also aligns the 'e' property of or_b, thresh and d: with bitcoin-core.
This has no effect on the final result, since the computed 'e' only
differed for nodes that are not 'm'.

A previous non-regression test lost its coverage after these changes;
wrapping the child in ltv: makes sure that it has e=1 but m=0, and the
test properly checks that thresh requires all the children to have 'm'.

As a reference, compare with:
https://github.com/bitcoin/bitcoin/blob/3eca89820e1fb152ebf0315e3924fc374cb35958/src/script/miniscript.cpp#L119-L230
https://github.com/bitcoin/bitcoin/blob/3eca89820e1fb152ebf0315e3924fc374cb35958/src/script/miniscript.h#L1046-L1051

Implementation and tests from Claude Opus 5.5.

91/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
Why it was queued
fuzzing or regression evidencesigning or wallet pathsecond-pass: security-sensitive path
AI analysis · Low 48/100

This commit fixes the Ledger Bitcoin app's internal checker for Miniscript wallet policies. The checker was incorrectly rejecting some valid Bitcoin spending policies as unsafe, and in a few places it was computing safety properties using formulas that differ from the reference implementation in Bitcoin Core. The changes make the Ledger app match Bitcoin Core's stricter-but-correct rules. There is no direct evidence in the commit that user funds were at risk of theft; the main effect was that legitimate wallet setups could be wrongly rejected.

AI review queuedFix ops computation for andor fragmentsby Salvatore Ingala · 86159d1e · Oct 22, 2026 · 3 filesMessage 86 · StrongModerate 68Details
Commit message · Salvatore Ingala

Fix ops computation for andor fragments

An incorrect result might allow registering policies that can't
later be spent.

As a reference, compare with: https://github.com/bitcoin/bitcoin/blob/3eca89820e1fb152ebf0315e3924fc374cb35958/src/script/miniscript.h#L1046-L1051

Tests generated with Claude Opus 5.5.

86/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
Why it was queued
signing or wallet pathsecond-pass: security-sensitive path
AI analysis · Moderate 68/100

This commit fixes a bug in how the Ledger Bitcoin app counts the number of Bitcoin script operations (ops) needed to spend certain wallet policies that use a 'miniscript andor' fragment. Because the count was wrong, the app could allow users to register wallet policies that look valid but cannot actually be spent later because they exceed Bitcoin's 201-op limit. The fix changes one variable in a formula so the correct dissatisfaction branch is counted, matching Bitcoin Core's reference implementation. New tests confirm the fix.

AI review queuedFix ops computation for l: and u: fragmentsby Salvatore Ingala · b6ac1de8 · Oct 22, 2026 · 3 filesMessage 78 · AdequateHigh 74Details
Commit message · Salvatore Ingala

Fix ops computation for l: and u: fragments

The computation was undercounting the number of ops, which would
potentially allow certain policies that are actually unspendable.

Tests generated with Claude Opus 5.5.

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 · High 74/100

This commit fixes a bug in how the Ledger Bitcoin app counts Bitcoin script operations ('ops') for two specific Miniscript fragments, 'l:' and 'u:'. Because the count was too low, the app could accept wallet policies that look valid but are actually impossible to spend from under certain conditions. The fix makes the operation count more conservative so such unspendable policies are rejected. New tests are added to prevent the bug from returning.

AI review queuedmusig_sessions: store up to 32 sessionsby Salvatore Ingala · a6798172 · Oct 21, 2026 · 4 filesMessage 78 · AdequateInformational 15Details
Commit message · Salvatore Ingala

musig_sessions: store up to 32 sessions

The previous limit of 8 is rather small, as a user might have multiple
accounts using MuSig2, each of them in a wallet that pre-generates
nonces.

Filling the whole storage makes the eviction test rather slow, so it
now only runs with --enable_slow_tests.

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 15/100

This commit is a simple capacity increase, not a security fix. It raises the number of simultaneous MuSig2 signing sessions the Ledger Bitcoin app can keep in memory from 8 to 32, because users with multiple MuSig accounts or wallets that pre-generate nonces could hit the old limit. The documentation and a test constant are updated to match, and the full-storage eviction test is made optional because filling 32 sessions is slow.

AI review queuedMerge pull request #574 from LedgerHQ/harden-bip340by Salvatore Ingala · 92d330c2 · Oct 19, 2026 · 1 fileMessage 58 · ThinModerate 59Details
Commit message · Salvatore Ingala

Merge pull request #574 from LedgerHQ/harden-bip340

Improve BIP-340 conformance

58/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Links an issue, advisory, or supporting reference! No meaningful explanatory body
Why it was queued
defensive validationsigning or wallet pathmerge-commit duplicate discountsecond-pass: security-sensitive path
AI analysis · Moderate 59/100

This commit hardens how the Ledger Bitcoin app creates Schnorr (BIP-340) signatures when signing Bitcoin transactions. It now injects its own auxiliary randomness and asks the device's crypto library to use it, then verifies every signature before releasing it. These changes reduce the risk that a broken random number generator or a computation fault could produce a weak or invalid signature that might leak the private key or be rejected by the network.

AI review queuedMerge pull request #573 from LedgerHQ/misc-fixesby Salvatore Ingala · 017aee47 · Oct 14, 2026 · 7 filesMessage 53 · ThinModerate 59Details
Commit message · Salvatore Ingala

Merge pull request #573 from LedgerHQ/misc-fixes

Miscellaneous fixes

53/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Links an issue, advisory, or supporting reference! 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 fixes three separate safety checks in Ledger's Bitcoin app. First, it prevents the app from building a response larger than the APDU buffer, which could previously overwrite the status word. Second, it refuses to register wallet policies containing multisig setups inside old-style P2SH scripts with more than 15 public keys, because Bitcoin consensus rejects scripts larger than 520 bytes. Third, it now rejects wallet policies at registration time that the device would later be unable to sign for, specifically policies where a single MuSig2 group contains more than one internal key, or where more than 8 key expressions involve internal keys. These are hardening fixes rather than a single critical vulnerability.

AI review queuedpython client: use default value for nSequence if not givenby Salvatore Ingala · 2bf0eed6 · Sep 18, 2026 · 1 fileMessage 65 · AdequateInformational 24Details
Commit message · Salvatore Ingala

python client: use default value for nSequence if not given

Matches BIP-370 and HWI's implementation upstream.

65/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
Why it was queued
signing or wallet pathsecond-pass: security-sensitive path
AI analysis · Informational 24/100

This commit fixes a small bug in the Python helper library that builds unsigned Bitcoin transactions from PSBT data. Previously, if a PSBT did not explicitly include a per-input sequence number, the code would crash with an assertion error. The change follows the BIP-370 standard and HWI by treating a missing sequence number as the default final value (0xffffffff). This is a client-side convenience fix; it does not change how the Ledger device itself validates or signs transactions.

AI review queuedVersion bump to v2.5.1by Ilya Artemov · e7618c98 · Sep 9, 2026 · 2 filesMessage 38 · OpaqueInformational 15Details
Commit message · Ilya Artemov

Version bump to v2.5.1

38/100 · OpaqueMessage clarity
✓ Subject identifies a change✓ Names a concrete action or component! No meaningful explanatory body
Why it was queued
second-pass: opaque commit message
AI analysis · Informational 15/100

This commit is a routine version bump from 2.5.0 to 2.5.1 for the Ledger Bitcoin app. It only updates the changelog and Makefile version number. No code changes are present in the diff, and no security fixes or vulnerabilities are described.

AI review queuedMerge pull request #546 from LedgerHQ/simplify_astby Salvatore Ingala · efee9c25 · Sep 3, 2026 · 12 filesMessage 73 · AdequateLow 27Details
Commit message · Salvatore Ingala

Merge pull request #546 from LedgerHQ/simplify_ast

Get rid of relative pointers in wallet policy AST

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Links an issue, advisory, or supporting reference
Why it was queued
signing or wallet pathmerge-commit duplicate discountsecond-pass: security-sensitive path
AI analysis · Low 27/100

This commit is a large internal refactoring of the Ledger Bitcoin app's wallet-policy parser. It replaces compact 'relative pointers' with ordinary memory pointers in the abstract syntax tree (AST) used to represent Bitcoin wallet descriptors. The change increases the memory each policy node uses, so the app also enlarges the policy buffer and updates related size limits. There is no direct evidence in the commit that this fixes an exploitable vulnerability; it appears to be a code-simplification and maintainability change. However, because it touches memory layout and parsing limits, it could indirectly affect security if the old relative-pointer scheme had subtle bugs or if the new buffer sizing introduces edge cases.

AI review queuedIncrease MAX_POLICY_KEY_INFO_LEN to the actual maximum; nits from PR reviewby Salvatore Ingala · afd42b6d · Sep 3, 2026 · 1 fileMessage 85 · StrongLow 37Details
Commit message · Salvatore Ingala

Increase MAX_POLICY_KEY_INFO_LEN to the actual maximum; nits from PR review

The value of MAX_POLICY_KEY_INFO_LEN did not quite reflect the
actual maximum. Unlikely to be hit in practice, because derivation
steps used in practice are small - but this fixes it, with some
increase in memory usage during wallet registration.

Other nits from PR review.

85/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
Why it was queued
signing or wallet pathsecond-pass: security-sensitive path
AI analysis · Low 37/100

This commit fixes a size limit in the Ledger Bitcoin app that was too small. The app uses this limit when registering Bitcoin wallet policies (descriptions of how to spend coins). The old limit underestimated how long a key description can be when many derivation steps are used. If a real wallet policy exceeded the old limit, the app could reject valid wallets or, in the worst case, mishandle memory. The commit also removes an unused header and updates related comments.

AI review queuedMerge pull request #559 from LedgerHQ/parse_unhardenedby Salvatore Ingala · 96e999fe · Aug 31, 2026 · 8 filesMessage 73 · AdequateModerate 61Details
Commit message · Salvatore Ingala

Merge pull request #559 from LedgerHQ/parse_unhardened

Always reject hardened derivation steps in `<M;N>` in wallet policies

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Links an issue, advisory, or supporting reference
Why it was queued
defensive validationsigning or wallet pathmerge-commit duplicate discountsecond-pass: security-sensitive path
AI analysis · Moderate 61/100

This update fixes a boundary bug in how the Ledger Bitcoin app parses wallet policies that use multi-path key expressions like /<M;N>/*. The app was supposed to reject hardened (high-security) derivation indexes, but it incorrectly allowed the exact boundary value 0x80000000 (2,147,483,648) as if it were unhardened. The patch changes the check from 'greater than' to 'greater than or equal to' so that hardened indexes are always rejected. The rest of the changes are minor cleanups: adding 'U' suffixes to numeric constants and using unsigned types in a few places to avoid comparison bugs.

AI review queuedLabel unsigned constants in constants.hby Salvatore Ingala · e1fcefb4 · Aug 31, 2026 · 6 filesMessage 60 · AdequateInformational 15Details
Commit message · Salvatore Ingala

Label unsigned constants in constants.h

This broke some comparisons under -Werror, so some small
adjustments were needed.

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

This commit only adds 'U' suffixes to numeric constants in a header file and makes a few matching type adjustments in C source files so the code still compiles cleanly with strict compiler warnings. It is a code-quality cleanup, not a security fix.

AI review queuedAdd regression test for unhardened derivation step parsingby Salvatore Ingala · ce2c25c6 · Aug 31, 2026 · 1 fileMessage 60 · AdequateLow 47Details
Commit message · Salvatore Ingala

Add regression test for unhardened derivation step parsing

60/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Mentions testing or verification! No meaningful explanatory body
Why it was queued
defensive validationfuzzing or regression evidencesigning or wallet pathsecond-pass: near security thresholdsecond-pass: security-sensitive path
AI analysis · Low 47/100

This commit only adds a new regression test to the Bitcoin app's test suite. The test checks that wallet policy key expressions reject a specific boundary value (2147483648, the first 'hardened' child index) where only 'unhardened' values are allowed. The commit message says an older version of the code incorrectly accepted this boundary value, but the actual code fix is not present in this commit—only the test is added. So this is a test-only change that documents a previously fixed parsing bug.

AI review queuedHarden count_distinct_keys_info to correctly count the used keysby Salvatore Ingala · d94c51a2 · Aug 27, 2026 · 4 filesMessage 65 · AdequateModerate 67Details
Commit message · Salvatore Ingala

Harden count_distinct_keys_info to correctly count the used keys

This avoids registering wallet policies that contain unused xpubs
that are not referenced in the descriptor template.

65/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
Why it was queued
defensive validationsigning or wallet pathsecond-pass: near security thresholdsecond-pass: security-sensitive path
AI analysis · Moderate 67/100

This commit fixes a bug in Ledger's Bitcoin app that could let a wallet policy slip through registration even when it contained unused or out-of-range public keys. The old code simply looked at the highest key index referenced in the wallet descriptor and assumed every key up to that number was used. That meant an attacker could craft a policy where the user's own key was listed as an unused extra key while the descriptor only required the attacker's key. The fix now explicitly counts which keys are actually referenced and rejects policies with gaps or unreferenced keys.

AI review queuedReject registering wallet policies with pubkeys not on the curveby Salvatore Ingala · d0c47c7a · Aug 27, 2026 · 1 fileMessage 73 · AdequateLow 44Details
Commit message · Salvatore Ingala

Reject registering wallet policies with pubkeys not on the curve

While this would be detected and fail at the first attempt at
deriving addresses from it, checking it early consts little.

73/100 · AdequateMessage clarity
✓ Specific, 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 · Low 44/100

This commit adds an early safety check in the Ledger Bitcoin app. Before registering a new wallet policy, the app now verifies that each public key is a valid point on the Bitcoin elliptic curve. Previously, an invalid public key would only be caught later when trying to derive addresses. Catching it earlier prevents the device from storing a broken or potentially manipulated wallet policy.

AI review queuedenable LTOby Mathias BROUSSET · 9b42a195 · Aug 24, 2026 · 1 fileMessage 0 · OpaqueInformational 15Details
Commit message · Mathias BROUSSET

enable LTO

0/100 · OpaqueMessage clarity
! Very short subject! Too few words to establish purpose! No meaningful explanatory body
Why it was queued
second-pass: opaque commit message
AI analysis · Informational 15/100

This commit simply turns on Link Time Optimization (LTO), a standard compiler feature that can make the app smaller and faster. There is no indication of a security bug or fix in the change itself or the commit message.

AI review queuedSupport musig in multi_a key expressionsby Salvatore Ingala · 5622eec3 · Aug 21, 2026 · 8 filesMessage 78 · AdequateLow 29Details
Commit message · Salvatore Ingala

Support musig in multi_a key expressions

musig() is deliberately rejected in sortedmulti_a, where sorting the
keys would require recomputing each aggregate key once per position;
doc/musig.md now documents that.

Also update some imprecisions in the documentation about
MAX_PUBKEYS_PER_MUSIG.

Add positive tests for musig in multi_a, and rejection test for musig
in sortedmulti_a (where sorting makes things more complicated).

The cleartext module makes sure that $keys only matches plain keys,
and not musig-aggregate keys.

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 · Low 29/100

This commit adds support for using MuSig multi-signature key groups inside taproot multi_a wallet policies on Ledger devices, while deliberately blocking them in sortedmulti_a. It also fixes a subtle parsing bug: previously, key expressions inside multi_a/sortedmulti_a were allocated one-by-one in a memory buffer, which would interleave badly with MuSig's own allocations and corrupt the in-memory layout. The new code parses all the keys into a temporary stack array first, then copies them into one contiguous allocation. Separately, the 'cleartext' human-readable display module now refuses to classify multisig patterns that contain musig keys, so the device falls back to showing the raw descriptor instead of potentially misleading text (for example, showing 'any 1 of two keys' for a musig that actually requires both).

AI review queuedAdd functional test for stale review state across commandsby Salvatore Ingala · 29d8d61d · Aug 17, 2026 · 70 filesMessage 75 · AdequateLow 48Details
Commit message · Salvatore Ingala

Add functional test for stale review state across commands

Verified to fail on the parent of the previous commit.

75/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Mentions testing or verification
Why it was queued
signing or wallet pathsecond-pass: unusually broad changesecond-pass: security-sensitive path
AI analysis · Low 48/100

This commit only adds a new automated test, plus screen snapshots used by that test. The test checks that after signing a Bitcoin transaction (PSBT), then signing a text message, the device does not accidentally reuse leftover display settings from the previous operation. The commit message says the test would have failed on an older version of the app, implying a prior UI bug existed. However, this commit itself does not change the app code, so it is not a fix and cannot be directly exploited. It is a regression test that documents a previous display-state issue.

AI review queuedNits from PR reviewby Salvatore Ingala · 48cb1764 · Aug 14, 2026 · 4 filesMessage 28 · OpaqueLow 36Details
Commit message · Salvatore Ingala

Nits from PR review

28/100 · OpaqueMessage clarity
✓ Subject identifies a change! No meaningful explanatory body
Why it was queued
signing or wallet pathsecond-pass: opaque commit messagesecond-pass: security-sensitive path
AI analysis · Low 36/100

This commit is a small follow-up cleanup to a previous pull request. It adds one safety step before validating a sorted key map, clarifies documentation about when missing map keys can be trusted, updates a copyright year, tightens a size check on a Bitcoin transaction field, and removes an oversized temporary buffer. The changes look like defensive hardening rather than a fix for an active bug, and the commit message gives no security context.

AI review queuedReplace the wallet policy AST relative pointers with native pointersby Salvatore Ingala · aa612cba · Aug 13, 2026 · 10 filesMessage 73 · AdequateLow 30Details
Commit message · Salvatore Ingala

Replace the wallet policy AST relative pointers with native pointers

Relative pointers saved some RAM, but added a significant amount of code
complexity - which is no longer a good tradeoff for devices post Nano S.

The "N bytes" comments on the node structures were wrong even before this
change: policy_node_s::flags is a struct of unsigned int bitfields, hence
4 bytes rather than 1, which made every node 6 bytes larger than
advertised. They are now the measured sizes for the 32-bit devices.

src/common/cleartext_match.c is generated, so the accessors are rewritten
in specs/bip388/gen.py and the file regenerated.

Also adds an assertion for an implicitly used invariant: multi() and
friends allocate their key expressions one at a time but index them as an
array, which only works if sizeof(policy_node_keyexpr_t) is a multiple of
the alignment buffer_alloc() pads to.

73/100 · AdequateMessage clarity
✓ Specific, 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 · Low 30/100

This commit is a code cleanup in Ledger's Bitcoin app. It replaces a memory-saving 'relative pointer' scheme with ordinary C pointers in the wallet-policy data structures. The change removes several hundred lines of pointer-conversion code and adds one compile-time check to make sure key-expression structures stay properly aligned when allocated back-to-back. There is no direct evidence in the commit that it fixes an active security bug; it reads as a maintainability/refactoring change to reduce complexity on newer Ledger devices that have more RAM.

AI review queuedEnlarge the buffers holding the parsed wallet policyby Salvatore Ingala · 18e01ab5 · Aug 13, 2026 · 4 filesMessage 95 · StrongLow 27Details
Commit message · Salvatore Ingala

Enlarge the buffers holding the parsed wallet policy

Preparing to rebuild the abstract syntax tree of a wallet policy with
native pointers, which will increase its size.

Measured over the largest policies of the test suite, the tree grows by
up to about 1.3x on the 32-bit devices, and up to about 2.2x in the
64-bit unit test builds; the growth is bounded by 1.5x and 3x
respectively, which are the growth factors of policy_node_tree_t, the
largest of any node type.

Therefore, we make MAX_WALLET_POLICY_BYTES scales with the size of a
pointer, rather than declaring a separate constant for unit tests.

Because Nano X has significantly less memory, we keep the maximum size
smaller, which incurs some risk of certain very complex policies no
longer fitting in memory. It should still be rare in practice.

95/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
Why it was queued
signing or wallet pathsecond-pass: security-sensitive path
AI analysis · Low 27/100

This commit increases the memory buffers used to store parsed Bitcoin wallet policies inside Ledger's Bitcoin app. It is a preparatory change for an upcoming internal refactor that will make the policy data structure larger. The change itself does not fix a known bug or vulnerability, but it adjusts memory limits to avoid future out-of-memory failures. The Nano X keeps a smaller buffer than other devices, which the commit notes could cause some very complex policies to be rejected.