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

Ensure the policy_map_descriptor buffer is 0-terminated

Public commit record

What the developer wrote

Authored by Salvatore Ingala

50/100 · Thin
Ensure the policy_map_descriptor buffer is 0-terminated

Reported by Cerberus
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
The short version

What changed, and why it matters

This commit fixes a buffer handling bug in the Ledger Bitcoin app's wallet registration code. The app now reserves one extra byte for the wallet policy descriptor string and explicitly writes a null terminator (the 'end of string' marker). Without this fix, code that reads the descriptor as a text string could keep reading past the intended data, potentially leaking nearby memory or behaving unpredictably. The issue was reported by an external party called Cerberus.

Recommended action

Review whether read_and_parse_wallet_policy() or its callers already enforce descriptor_template_len <= MAX_DESCRIPTOR_TEMPLATE_LENGTH, and confirm the +1 byte does not break any stack-size assumptions. Consider adding an explicit static assertion or runtime check that descriptor_template_len < sizeof(policy_map_descriptor).

Security signals we found

01

Buffer not null-terminated before string use

02

Potential out-of-bounds read / information disclosure

03

External security report credited (Cerberus)

04

Single-file, surgical patch in wallet registration handler

Risk score

Why this scored 63/100

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