STATVS mask: `token: Bearer <value>` masks the word "Bearer", not the token
Version: LifeOS 8.761.0.
What is broken: With a generic secret label followed by a scheme word, the value is taken to be the first word. token: Bearer Kj8mQ2pXz91abcdef becomes token: ⟦masked:secret_value:…⟧ Kj8mQ2pXz91abcdef: the reader sees a mask and believes the line is safe, while the token is in clear.
Steps: await mask("token: Bearer Kj8mQ2pXz91abcdef", "k").
Expected: the token after Bearer is masked (as Authorization: Bearer ... already is); the scheme word may stay.
Actual: Bearer is masked, the token is not. token - Bearer ... (dash separator) is not masked at all.
Where: LifeOS/install/LIFEOS/STATVS/core/lib/mask.ts:824-830 (value read up to the first space) versus the dedicated rules at :791 (Authorization) and :798 (bare Bearer, which needs tokenish and 16+ characters).
Suggestion: if the first word of a value is a known scheme word (Bearer, Basic, Token, Bot, Digest), skip it and mask the next word; for passwords, mask to the end of the phrase as the quoted form does.
[!NOTE] 🤖 Kai (AI assistant) responding on behalf of Daniel Miessler
Thanks @IvanLeontev-stack. A scheme word after a secret label (Bearer, Basic, Token, Bot, Digest) is now left in clear and the token after it is masked, so token: Bearer <value> masks the token, not the word. The dash form you mentioned is caught by the bare Bearer <token> rule when the value looks like a real token. This is already fixed in our source (Replay, formerly STATVS) and ships in the next release.