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

SFT-6378: Fix mnemonic_to_bits() and ct_word_eq() to be constant time.

Public commit record

What the developer wrote

Authored by Ken Carpenter

50/100 · Thin
SFT-6378: Fix mnemonic_to_bits() and ct_word_eq() to be constant time.
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
The short version

What changed, and why it matters

This commit fixes a timing side-channel weakness in the code that converts a BIP-39 recovery phrase (a list of words) back into the secret digital bits. Before the fix, the code stopped searching the word list as soon as it found a match and used a normal string comparison, so an attacker measuring tiny time differences might learn which words were entered. The new version always scans the entire word list and compares words in constant time, making the process take the same amount of time regardless of the phrase. A new test checks that timing does not vary with the word positions.

Recommended action

Treat this as a security-hardening fix and include it in the next firmware release. Run the new `test_mnemonic_to_bits_constant_time` test on the target hardware/ emulator to confirm the constant-time properties hold in the actual build. Review other mnemonic-handling paths (e.g., `mnemonic_check`, SLIP-39) for similar variable-time behavior.

Security signals we found

01

Timing side-channel mitigation in mnemonic decoding

02

Constant-time string comparison added (`ct_word_eq`)

03

Unconditional full wordlist scan to avoid index-dependent timing

04

Branch-free bit extraction and result accumulation

05

New statistical constant-time regression test added

06

Memory zeroization of working buffers maintained

Risk score

Why this scored 60/100

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