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

Increase MAX_POLICY_KEY_INFO_LEN to the actual maximum; nits from PR review

Public commit record

What the developer wrote

Authored by Salvatore Ingala

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

What changed, and why it matters

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.

Recommended action

Treat this as a hardening/correctness fix. Review callers that use MAX_POLICY_KEY_INFO_LEN and MAX_WALLET_POLICY_SERIALIZED_LENGTH_* to ensure they now allocate sufficient memory and do not retain any hard-coded smaller assumptions. No immediate incident response is indicated, but users should update to a build containing this commit if they register wallets with deep or non-standard derivation paths.

Security signals we found

01

Buffer/limit size correction for key origin info

02

Removal of unused ledger_assert.h include

03

Comment-only updates to serialized wallet policy length bounds

04

Memory usage increase during wallet registration explicitly noted

Risk score

Why this scored 37/100

Our methodology →
Potential impact 8/30
Exploitability 7/25
Stealth signal 6/15
Affected reach 7/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.