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

hww: reset sessions on host reconnect

Public commit record

What the developer wrote

Authored by benma's agent

78/100 · Adequate
hww: reset sessions on host reconnect

When a host disconnects after receiving an intermediate response, a workflow can remain in
next_request().await while the device stays powered. The HWW lock has already been released, so
the USB timeout does not cancel it. On reconnect, the Python client's attestation request is
consumed as the old workflow's continuation and receives an error encrypted with the old Noise
session instead of an attestation response.

Add a top-level REQ_RESET that cancels the pending task, discards queued HWW responses, resets
Noise and restores the UI before acknowledging the new session. Drop task-owned UI components
before resetting the screen stack, and refuse reset while a U2F workflow owns the shared UI.
Allow REQ_INFO through the HWW busy gate without refreshing the operation timeout, so the host
can discover the firmware version before deciding whether to reset.

Bump the firmware to v9.28.0 and have the Python client issue REQ_RESET before attestation,
unlock and Noise setup only on v9.28.0 or newer. Add regression tests for abandoned
continuations, pending responses, U2F arbitration, INFO timeout behavior and client
compatibility. The powered-device reconnect flow still needs hardware validation.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit fixes a bug in the BitBox02 hardware wallet where unplugging the USB cable at the wrong moment could leave a half-finished operation running. If the device stayed powered and a new host reconnected, the new host's first message could be misinterpreted as a continuation of the old operation, producing a confusing encrypted error instead of a proper response. The fix adds a new 'reset session' command that the companion app sends at the start of every connection on firmware 9.28.0 and newer, which cancels any leftover task, clears queued responses, resets the encrypted Noise channel, and restores the user interface. The change also lets the host ask for the firmware version without extending an abandoned operation's timeout, so it can safely decide whether to reset.

Recommended action

Treat this as a security-hardening fix with a clear bug-class remediation. Users should upgrade to firmware v9.28.0 and update the Python client so that the new REQ_RESET handshake is used. Developers should verify the powered-device reconnect flow on real hardware as noted in the commit message, and review that no other async workflows can leak state across host sessions.

Security signals we found

01

Fixes cross-session state confusion on USB reconnect

02

Adds explicit session reset command to cancel stale async workflows

03

Resets Noise cryptographic session to prevent old-key encrypted responses

04

Clears queued USB responses that could leak to a new host

05

Guards reset against U2F UI ownership to avoid interrupting security operations

06

Allows version discovery without refreshing abandoned operation timeout

07

Includes regression tests for abandoned continuations, pending responses, U2F arbitration, INFO timeout behavior, and client compatibility

Risk score

Why this scored 62/100

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