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

Merge pull request #1042 from Chaitanya-Keyal/op-return-push-opcode

Public commit record

What the developer wrote

Authored by Nick Klockenga

73/100 · Adequate
Merge pull request #1042 from Chaitanya-Keyal/op-return-push-opcode

Parse the OP_RETURN push opcode instead of assuming OP_PUSHDATA1
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit fixes how SeedSigner reads the extra data attached to OP_RETURN Bitcoin transaction outputs. Previously the code always assumed the data was introduced by OP_PUSHDATA1, which meant it would misread or crash on the more common direct-push encoding used for small payloads (75 bytes or fewer). The change teaches the parser to read the actual push opcode, handles larger OP_PUSHDATA2/OP_PUSHDATA4 payloads, and now rejects malformed scripts instead of silently misinterpreting them. It also adds a user-facing warning screen when this happens.

Recommended action

Reviewers should verify that _parse_op_return_payload correctly rejects all non-standard scripts, that the new PSBTMalformedOpReturnView cannot be bypassed to continue signing, and that existing OP_RETURN screenshots/tests still pass. Consider whether any downstream display code safely handles the returned raw bytes, including OP_0-OP_16 opcode bytes.

Security signals we found

01

Fixes incorrect parsing of OP_RETURN data due to assumed push opcode

02

Adds robust handling for direct push, OP_PUSHDATA1/2/4, and OP_0-OP_16

03

Introduces explicit malformed-script rejection instead of silent mis-parsing

04

Adds UI flow that aborts signing on malformed OP_RETURN

05

Includes unit and flow tests for parsing edge cases

Risk score

Why this scored 51/100

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