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

Fix: Reject dead-TRNG output in get_random_bytes (#370) (#372)

Public commit record

What the developer wrote

Authored by White7hat7

93/100 · Strong
Fix: Reject dead-TRNG output in get_random_bytes (#370) (#372)

Co-authored-by: Nazim <nazim@openclaw.ai>
Co-authored-by: k9ert <117085+k9ert@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit fixes a security bug in how Specter DIY generates random numbers for creating cryptocurrency wallet secrets. Previously, if the hardware random-number generator (TRNG) stalled or failed, the device would silently use all-zero or mostly-repeated bytes, which could lead to predictable private keys and seed phrases. The patch adds a sanity check that rejects such 'dead' random output and raises an error instead of using it. The bug is serious because weak randomness can let an attacker guess a user's wallet keys, but the patch only detects obvious failures (all-zero or heavily repeated output), not every possible TRNG weakness.

Recommended action

Treat this as a security fix and include it in release notes. Users should upgrade firmware to a release containing this commit. Device operators should be instructed that an 'RNG Error' alert means the device could not generate safe randomness and they should retry; if it recurs, the device should not be used for key generation. Review whether other randomness consumers (e.g., nonce generation, BIP39 passphrase derivation) also call get_random_bytes and are now protected by this check. Consider whether additional runtime health monitoring or a redundant entropy source is warranted, since the patch does not detect subtle bias.

Security signals we found

01

Silent use of dead TRNG output for cryptographic seed generation

02

TRNG timeout returns 0 per byte, producing all-zero or majority-zero buffers

03

Entropy pool was fed with dead bytes before any validation

04

Raw TRNG path for requests >64 bytes had no fallback or mixing

05

New RNGError is a BaseError so the UI shows an alert instead of crashing

06

Sanity check is explicitly described as a liveness check, not a full health proof

Risk score

Why this scored 77/100

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