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

Clear the sign_psbt state on every exit path of handler_sign_psbt

Public commit record

What the developer wrote

Authored by Salvatore Ingala

85/100 · Strong
Clear the sign_psbt state on every exit path of handler_sign_psbt

Move the handler's body in an internal function, so that initialization
and zeroing of any internal state used in the handler is guaranteed.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
The short version

What changed, and why it matters

This commit refactors the Bitcoin app's PSBT signing handler so that sensitive temporary data (keys, transaction details, signing state) is always wiped from the device's stack memory when the handler finishes, even if it exits early due to an error. Before the change, some early return paths could leave that data in memory. The patch itself does not claim to fix an active exploit, but it removes a class of information-disclosure risk.

Recommended action

Treat as a defensive hardening commit. Review whether any other handlers in the app use similar local sensitive state without guaranteed explicit_bzero cleanup, and apply the same wrapper pattern if so. No immediate incident response is indicated by the diff alone.

Security signals we found

01

explicit_bzero used to clear signing state, cache, and PSBT state on all exit paths

02

Refactor moves early-return logic into a wrapper so cleanup always runs

03

Targets residual secret/sensitive data left on the stack after signing operations

04

No functional change to signing logic; change is purely cleanup/initialization ordering

Risk score

Why this scored 59/100

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