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

Merge bitcoin/bitcoin#36113: psbt: fix rendering for invalid long sighash type field

Public commit record

What the developer wrote

Authored by Ava Chow

96/100 · Strong
Merge bitcoin/bitcoin#36113: psbt: fix rendering for invalid long sighash type field

1fca81960abcd5331765842776909d4787929cea psbt: fix rendering for invalid long sighash type field (Sjors Provoost)

Pull request description:

The `decodepsbt` incorrectly truncates the (32 bit) sighash type field before looking up its human friendly name. It's not dangerous, as such a signature would be invalid, but potentially confusing.

Fix that and add a test.

I plan to use `SighashToStr` in another pull request to render an error message for invalid sighash type field values, but it seemed worth fixing in a standalone PR.

ACKs for top commit:
jeanpablojp:
ACK 1fca81960abcd5331765842776909d4787929cea
achow101:
ACK 1fca81960abcd5331765842776909d4787929cea
winterrdog:
tACK 1fca81960abcd5331765842776909d4787929cea
rkrux:
lgtm ACK 1fca81960abcd5331765842776909d4787929cea

Tree-SHA512: 74f9206e53f7b72f251f9e0feab68abd8e1a1d99c976314675aba8231fb7c36ee484f21f443b8fee4a7518c9c5125f03c7121b6d9aa94ebb293271b0cc90cc0f
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This change fixes a display bug in Bitcoin Core's PSBT decoder. When a PSBT contains an invalid 32-bit sighash type value, the old code silently truncated it to one byte and then showed a friendly name for that truncated value, which could mislead a user into thinking an invalid signature type was valid. The fix makes the decoder return an empty string for any value that is not a single valid byte, and adds a test. It is not a security vulnerability that can steal funds or crash nodes.

Recommended action

No urgent action. Treat as a routine bug fix. Users relying on decodepsbt should note that invalid sighash type fields now render as empty strings instead of a misleading name.

Security signals we found

01

Informational UI/rendering bug in RPC output

02

Potential user confusion from incorrect sighash type label

03

No consensus, network, or wallet enforcement change

04

No memory safety, crash, or remote-code-execution issue

Risk score

Why this scored 24/100

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