Skip to content

A sig / hmac / pass name is masked in a capability's status line but not in the log and the diagnostics report #3291

Closed

Description

@HugoXK

Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment on this issue.

Written-by: FlyBot Lead
Claimed-by: FlyBot Lead
Claim-Id: 34dad2dbf4854df5b362b06c069ecb43
Branch: dev/1-diagnostics-sig-hmac-pass
Base: f3b2be1
At: 2026-11-21T18:51:38Z

Bot: FlyBot Dev-1

What is wrong

Two lists promise the same thing and only one of them keeps it.

withoutCredentialValues (core/src/host/capabilities.js:67) masks a capability's own value under a credential name, and since #3278 the name list carries hmac and sig/pass as whole segments — core/test/capabilities.test.js:691 pins X-Sig, X-Hmac and X-Pass.

The face that writes the diagnostics report and the downloaded log is cleaned by a second list, CREDENTIALS in core/src/host/diagnostics.js:43-54. Its name:value entry (:54) names only api[_-]?key|authorization|x-api-key|password|secret. The same three names are missing there, so the same header, arriving one function away, is written whole.

Measured on live main f3b2be1e by running CREDENTIALS over exactly the strings cleanText receives (read-only):

"X-Sig: abcdef123456"     -> "X-Sig: abcdef123456"      (want X-Sig: [hidden])
"X-Hmac: abcdef123456"    -> "X-Hmac: abcdef123456"     (want X-Hmac: [hidden])
"X-Pass: abcdef123456"    -> "X-Pass: abcdef123456"     (want X-Pass: [hidden])
"x-api-key: abcdef123456" -> "x-api-key: [hidden]"      (the shape this list does keep)
"assign: 9000" / "bypass: 9000" -> unchanged            (the boundary must keep these)

Why it matters

cleanText is the one function the diagnostics report and the downloaded log print through (core/src/host/diagnostics.js:206 and :211, both with redact: rt.redactSecrets). A capability whose server echoes a request header, or any logged sentence carrying X-Sig: <value>, reaches the user's own report with the literal intact — while a line carrying x-api-key: <value> in the same report is masked. The name makes its promise in the status line and is hollow on exactly the face a user sends out.

Expected behaviour

  • The three names mask their own value on this face too: sig and pass as whole segments (so assign, compass and bypass keep their text, the same boundary capabilities.js uses), hmac needing none; six characters minimum, quote-aware like the existing entry.
  • Tests, red-first, in core/test/diagnostics.test.js: each of the three names masks its value; the three lookalikes and a five-character value stay byte-identical; the existing report assertion is unchanged.
  • The fallback if a name cannot be masked safely on this free-text face: write the limit into docs/subsystems/core-host.md and say in the PR body which name was left, why, and what text it would otherwise have eaten. Do not widen the pattern into swallowing ordinary words to force a green.
  • docs/subsystems/core-host.md (the diagnostics/log row names what it masks, or records the limit) and a changelog.d/ fragment in the same PR.

Scope

  • core/src/host/diagnostics.js — the one CREDENTIALS entry.
  • core/test/diagnostics.test.js — the cases above.
  • docs/subsystems/core-host.md, changelog.d/<this issue>.fixed.md.

Out of scope: the capabilities.js collector (it already covers these names, #3278/#3279/#3281); #3276 (what a literal credential may be kept at rest, and the Settings read-back); the DSH-side connection attempt failed: <error> log line, which is outside this repository.

Tier and gates

T2 by .github/agent/risk-rules.json (core/src/host/**), so the PR needs a Verdict: PASS naming its tip.

Dedup

Searched open and closed issues for cleanText, diagnostics credential, sig hmac pass and mask: #3275, #3277, #3278, #3279, #3281 and #3288 are all the capability status-line collector (all closed); only #3276 (needs-human) touches what is stored and read back. No open issue names the diagnostics CREDENTIALS list. Live main f3b2be1e still prints the three values verbatim through cleanText.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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