Skip to content

Embedded index extraction uses English wordlist for non-English mnemonic shares #85

Description

@luislake19

# Language is not propagated to embedded index extraction for non-English mnemonic shares

Summary

The embedded index extraction logic appears to use the default English BIP39 wordlist even when mnemonic shares are generated or processed using a different supported language.

This can cause failures when a valid non-English mnemonic word is processed against the English wordlist.

Impact

Severity: High

Category: Potential loss of access

The project supports non-English BIP39 wordlists, including Spanish.

If embedded index extraction does not use the same language selected during share generation and recovery, valid shares may become unrecoverable.

Affected Components

  • get_mnemonic_checksum_data(...)
  • Embedded index extraction path
  • Recovery path when embedded_index=True

Root Cause

The checksum/index extraction path appears to load the default wordlist:

word_list = load_word_list()

rather than propagating the language selected by the caller.

The recovery path accepts a language parameter:

combine_mnemonic(..., language="spanish")

but the embedded index extraction logic appears to use the default English wordlist.

Independent Verification

I was unable to build the complete package in my Windows environment due to native extension dependencies.

However, the root cause can be reproduced independently using the project's BIP39 wordlists.

Test share:

antena comida cordón uno lunes empleo cubrir boina conocer brusco noche malo

Verification output:

Share last word: malo

Using spanish wordlist:
.../spanish.txt

Using english wordlist:
.../english.txt

Last word in Spanish wordlist: True
Last word in English wordlist: False

Trying buggy checksum/index extraction...

ValueError: 'malo' is not in list

This demonstrates that a valid Spanish mnemonic word fails when processed against the English BIP39 wordlist.

Expected Behavior

The embedded index extraction logic should use the same language selected for share generation and recovery.

A valid Spanish mnemonic share should be processed using the Spanish BIP39 wordlist.

Suggested Fix

Propagate the selected language into the checksum/index extraction path.

Example direction:

def get_mnemonic_checksum_data(
    mnemonic,
    language="english",
    word_list_dir=None,
    word_list=None
):
    if word_list is None:
        word_list = load_word_list(language, word_list_dir)

and ensure all callers pass the selected language.
Tested against pybtc 2.3.1 source distribution.

Security Relevance

This issue may affect recovery of mnemonic shares generated from supported non-English BIP39 wordlists when embedded indexes are used.

The impact is potentially loss of access despite possessing valid shares.

Attachments

A minimal reproduction script is attached to this report.

minimal_language_bug_check.py

pybtc_spanish_embedded_index_bug_repro.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions