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

Reject duplicate keys and truncated maps when parsing PSBT maps in sign_psbt

Public commit record

What the developer wrote

Authored by Salvatore Ingala

73/100 · Adequate
Reject duplicate keys and truncated maps when parsing PSBT maps in sign_psbt

parse_stream_to_map silently kept the last value of a repeated key, so a
PSBTv2 object whose unknown entries collided with a typed key could make
the client commit to maps different from the typed fields of the object.

Further tightening: also fail on truncated maps and on trailing data
after the PSBT maps in sign_psbt. PSBT.deserialize now rejects trailing
data, missing map separators and truncated strings too: for bytes and
base64 inputs, the PSBT is reserialized before reaching the checks in
sign_psbt, which would drop the trailing data and restore the missing
bytes.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit fixes a bug in how the Ledger Bitcoin app client parses PSBT (Partially Signed Bitcoin Transaction) maps. Previously, if the same key appeared twice in a map, the parser silently kept the last value. A malicious or malformed PSBT could use this to make the device commit to one set of data while the client software saw another, potentially causing the user to sign a transaction different from what they reviewed. The fix also rejects truncated PSBTs and extra trailing data, which could otherwise be silently repaired during reserialization and hide attacks.

Recommended action

Treat this as a security fix and include it in the next release. Users and integrators should update the Python client library. Review any PSBT workflows that previously accepted malformed or duplicate-key PSBTs, as they will now raise errors. No CVE or vendor advisory was supplied; consider requesting a security advisory from Ledger if one is not already published.

Security signals we found

01

Silent overwrite of duplicate PSBT map keys could create commitment mismatch between client and device

02

Truncated PSBT maps were silently accepted due to exception swallowing in deserialization loops

03

Trailing data after PSBT maps was ignored, allowing reserialization to silently normalize malformed inputs

04

PSBTv2 unknown entries colliding with typed keys could alter the map commitment without affecting typed fields

Risk score

Why this scored 72/100

Our methodology →
Potential impact 22/30
Exploitability 16/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.