AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
High 74 Bitcoin

Fix ops computation for l: and u: fragments

Public commit record

What the developer wrote

Authored by Salvatore Ingala

78/100 · Adequate
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.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
The short version

What changed, and why it matters

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.

Recommended action

Treat this as a security-relevant correctness fix. Review whether any already-registered wallet policies on deployed devices could have exploited the undercount, and consider whether a firmware update or policy re-validation is needed. Ensure the new regression tests are run in CI.

Security signals we found

01

Undercounting of script operation budget leading to acceptance of unspendable policies

02

Incorrect handling of Miniscript wrapper dissatisfaction semantics

03

Policy sanity check bypass via operation-count accounting flaw

04

Regression tests added for 'l:' and 'u:' wrappers and 201-op limit boundary

Risk score

Why this scored 74/100

Our methodology →
Potential impact 22/30
Exploitability 18/25
Stealth signal 12/15
Affected reach 10/15
Confidence 8/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.