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

Enlarge the buffers holding the parsed wallet policy

Public commit record

What the developer wrote

Authored by Salvatore Ingala

95/100 · Strong
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.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
The short version

What changed, and why it matters

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.

Recommended action

Treat as a routine capacity adjustment rather than a security patch. Review the follow-up AST refactor for memory safety, ensure Nano X's reduced limit is enforced safely, and verify that policy parsing fails gracefully with a clear error when the buffer is too small rather than corrupting state.

Security signals we found

01

Memory limit increase for parsed policy AST

02

Device-specific smaller limit on Nano X due to RAM constraints

03

Preparatory change for future AST pointer refactor

04

No bounds-check or parser logic changes visible in diff

05

No vendor statement that this fixes a security issue

Risk score

Why this scored 27/100

Our methodology →
Potential impact 5/30
Exploitability 3/25
Stealth signal 4/15
Affected reach 6/15
Confidence 6/10
Evidence quality 3/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.