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

Merge pull request #539 from LedgerHQ/fix-stack-exhaustion

Public commit record

What the developer wrote

Authored by Salvatore Ingala

58/100 · Thin
Merge pull request #539 from LedgerHQ/fix-stack-exhaustion

Fix stack exhaustion
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Links an issue, advisory, or supporting reference! No meaningful explanatory body
The short version

What changed, and why it matters

This update fixes a stack-exhaustion weakness in Ledger's Bitcoin app. A malicious or unusually crafted wallet policy (the text string that describes how coins can be spent) could make the app recurse so deeply that it runs out of call stack and crashes. The patch adds depth limits during parsing, reduces large on-stack buffers, and moves big buffers out of recursive functions so the app rejects oversized policies safely instead of crashing.

Recommended action

Treat this as a security fix and include it in the next firmware/app release. Ensure the new depth limits are enforced consistently across all policy-walking code paths and that fuzzing targets exercise deep wrapper chains and nested thresh expressions.

Security signals we found

01

Stack exhaustion / unbounded recursion in policy parsing and validation

02

Missing depth accounting for miniscript wrapper chains

03

Large automatic arrays inside recursive functions (compute_thresh_ops / compute_thresh_stacksize)

04

Large handler buffers kept live during recursive policy walks

05

New explicit limits: MAX_PARSE_SCRIPT_RECURSION_DEPTH 16, MAX_THRESH_NESTING 4, MAX_N_IN_THRESH 24

Risk score

Why this scored 72/100

Our methodology →
Potential impact 22/30
Exploitability 16/25
Stealth signal 10/15
Affected reach 12/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.