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

Fix ScriptBuf::push_slice() handling of 0x00

Public commit record

What the developer wrote

Authored by Nadav Ivgi

60/100 · Adequate
Fix ScriptBuf::push_slice() handling of 0x00

And delegate Builder::push_slice() to use it.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
The short version

What changed, and why it matters

This commit fixes how the library builds Bitcoin script instructions when pushing a single zero byte (0x00) onto the stack. Previously, ScriptBuf::push_slice() emitted an invalid opcode (OP_PUSHBYTES_0, which does not exist in Bitcoin) for a 0x00 byte, while Builder::push_slice() had its own separate logic that already handled 0x00 correctly by falling through to a normal non-minimal push. The patch makes Builder delegate to ScriptBuf so both behave the same way, and changes ScriptBuf to emit a valid push instruction for 0x00. A script containing the invalid opcode would be rejected by the Bitcoin network, so this is a correctness/security bug in transaction/script construction.

Recommended action

Review any code that uses ScriptBuf::push_slice() to push a single 0x00 byte, especially in transaction or script generation paths, and verify that the resulting scripts are now valid. Consider adding regression tests for 0x00 and other boundary single-byte pushes. Upgrade to the patched version.

Security signals we found

01

Script construction correctness bug

02

Invalid Bitcoin opcode emitted for 0x00 byte push

03

Potential transaction/script invalidity if generated script is used

04

Unification of duplicated push_slice logic between Builder and ScriptBuf

05

No explicit CVE or vendor security disclosure in commit

Risk score

Why this scored 63/100

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