Skip to content

Consider obscuring seed from Debug implementation of Mnemonic #92

@TheButlah

Description

@TheButlah

Its a common footgun that secrets get leaked in log messages when types containing private secrets implement Debug, whose implementation actually prints the secret.

bip39 should instead do something like:

impl fmt::Debug for Mnemonic {
	fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
		f.debug_struct("Mnemonic")
			.field("lang", &self.0.language())
			.finish_non_exhaustive()
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions