A wallet recovery phrase is written into the source

tx0/ts:mnemonic-phrase-literaldefaulterrorsecurity/secretsdepth fastsecurity, cwe-798

What it finds

A recovery phrase of 12 to 24 words gives full control over the cryptocurrency wallet derived from it. In the source it is visible to everyone with access to the code and its history, and cannot be changed without moving the funds.

Reported are string literals of 12, 15, 18, 21 or 24 lower-case words of three to eight letters assigned to a variable or property whose name mentions a mnemonic, seed, phrase or recovery words.

From the rule's source, mnemonic_phrase_literal.rs.

Example from the rule's tests
export const mnemonic = "abandon ability able about above absent absorb abstract absurd abuse access accident";tx0 reports: this looks like a wallet recovery phraseexport const title = "a short sentence";
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

Turn it on, off or suppress it

The rule runs in every tier. To turn it off for a project, set its level in tx0.toml:

tx0.toml
[rules]
"tx0/ts:mnemonic-phrase-literal" = "off"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/ts:mnemonic-phrase-literal] reason="..."

tx0 explain tx0/ts:mnemonic-phrase-literal shows the same in the terminal. Found a false positive? Report it.