You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A sig / hmac / pass name is masked in a capability's status line but not in the log and the diagnostics report - #3292
Two name lists promise the same masking and only one of them kept it. capabilities.js masks a capability's own value under sig, hmac and pass (since #3278, pinned by core/test/capabilities.test.js:691), but the list the diagnostics report and the downloaded log are cleaned with — CREDENTIALS in core/src/host/diagnostics.js — named only api[_-]?key|authorization|x-api-key|password|secret. Measured on live main f3b2be1e by running cleanText over the exact strings:
X-Sig: abcdef123456 → unchanged
X-Hmac: abcdef123456 → unchanged
X-Pass: abcdef123456 → unchanged
x-api-key: abcdef123456 → x-api-key: [hidden]
cleanText is the one function the report and the downloaded log print through (diagnostics.js:206 / :211), so a log line or a report row carrying X-Sig: <value> reached the user's own report whole while a line carrying x-api-key: <value> beside it was masked.
Fix
One entry in the diagnostics CREDENTIALS list: sig and pass as whole segments, the same boundary capabilities.js uses, so assign, compass and bypass keep their text; hmac is not part of an ordinary word and needs no boundary. Six characters minimum and quote-aware like the entry beside it, so a JSON body ({"sig":"…"}) is masked too and a five-character value is left alone rather than eating the words around it. Nothing else in the list changed and no name was added.
Red first (each name independent)
The three tests were committed and run before the fix, on the same base f3b2be1e:
not ok 3 - cleanText hides the value of a sig header — actual X-Sig: abcdef123456, expected X-Sig: [hidden]
not ok 4 - cleanText hides the value of an hmac header — actual X-Hmac: abcdef123456
not ok 5 - cleanText hides the value of a pass header — actual X-Pass: abcdef123456
ok 6 - cleanText keeps assign, compass and bypass and leaves a five-character value — the boundary and the under-six bound stay green in the same run
# tests 82 / # pass 79 / # fail 3 at that commit; 82/82 after the fix
One test per name, so a list entry that misses one of the three cannot pass behind the other two.
Ran at the tip
cd core && node --import ./test/harness-resolve.mjs --test test/diagnostics.test.js → 82/82
ARCH_DOCS_BASE=f3b2be1e npm run arch-docs (in core/) → arch-docs: OK (6 changed file(s))
node scripts/ds-bot-patches.mjs generate then check → 10 patches apply cleanly, core/ equals ds-bot/ + patches; canonical → ok patches/ds-bot/ is what generate writes (generate is a no-op)
node .github/scripts/changelog.mjs check → 2 fragments well formed
node .github/scripts/check-mojibake.mjs → 0 occurrences of U+FFFD in 1777 text files
Not run: the smoke test (the change is one regex entry in a pure text helper, no new endpoint or startup path), and the CI package job's pack check, typecheck and actionlint.
Tip: 27d0ffe86e2e96cadf8c1ea46848cb4d9c444bf0, tree 19e5a5aee82d5aa82f6b6f9fb6f953fb81f1aa2c, base and merge-base f3b2be1ed045560749c5b277b57648217a429d00. Verified commit f78fce610aa39090b1f2aeb3959085d19b070196 (same tree; the push path rebuilds the head from that tree on the live base), and every reading below was taken at it before the push.
Checkpoint
{
"pr": 3292,
"claim": "Dev-1",
"issue": 3291,
"summary": "The diagnostics report and the downloaded log now mask a value written after X-Sig, X-Hmac or X-Pass, one CREDENTIALS entry with sig and pass bounded as whole segments so assign, compass and bypass keep their text and hmac unbounded. Six-character minimum and quote-aware, so a JSON body is masked and a five-character value is left alone. Three red-first tests, one per name, plus the boundary and under-six guards.",
"files": ["core/src/host/diagnostics.js", "core/test/diagnostics.test.js", "docs/subsystems/core-host.md", "changelog.d/3291.fixed.md", "patches/ds-bot/0001-core-fixes.patch", "patches/ds-bot/0007-version-and-tooling.patch"],
"checks": { "ran": "TZ=UTC npm run verify", "result": "green", "at": "27d0ffe86e2e96cadf8c1ea46848cb4d9c444bf0" },
"next": "ready for review at the pushed head"
}
@Birfy review request — tip 27d0ffe86e2e96cadf8c1ea46848cb4d9c444bf0 (T2, core/src/host/**).
What changed: one entry in CREDENTIALS in core/src/host/diagnostics.js — the list cleanText applies before the diagnostics report and the downloaded log are written (:206, :211). It now names sig and pass as whole segments (the same boundary capabilities.js uses) and hmac, six-character minimum, quote-aware, so X-Sig: …, X-Hmac: …, X-Pass: … and a JSON body {"sig":"…"} are masked while assign, compass and bypass keep their text and a five-character value is left alone. Nothing else in the list changed and no other name was added.
Red first, committed and run before the fix on base f3b2be1e: three tests, one per name (X-Sig, X-Hmac, X-Pass, each actual … expected [hidden]) plus the boundary/under-six guard green in the same run — # tests 82 / # pass 79 / # fail 3; 82/82 after the fix. TZ=UTC npm run verify exit 0 at the tip (core 3424/3424, all other suites green), arch-docs OK (6 files), patches canonical ok, changelog 2 fragments.
One note on the body, no code effect and no commit: its checkpoint still says "pr": 0, which enqueue-rules.mjs:440-441 refuses for any pull request other than 0; the author is correcting that field and the Tip line in the body against this same head. The head does not move.
If the change holds, a Verdict: PASS at 27d0ffe86e2e96cadf8c1ea46848cb4d9c444bf0 is what this tip needs.
Red first — the second run is this tip with only core/src/host/diagnostics.js restored from base f3b2be1e, and the three failures are exactly the three new assertions:
not ok 3 - cleanText hides the value of a sig header
not ok 4 - cleanText hides the value of an hmac header
not ok 5 - cleanText hides the value of a pass header
Review points:
core/src/host/diagnostics.js:55-60 — one new CREDENTIALS entry: hmac unbounded, sig / pass as whole segments via (?<![a-z0-9])…(?![a-z0-9]), six-character minimum and quote-aware on both sides, so X-Sig: …, X-Hmac: …, X-Pass: … and {"sig":"…"} mask while assign, compass and bypass stay. The lookbehind boundary is inside an i-flagged group and Node 22 has lookbehind; no other entry changed. A value under six characters is left alone, matching the entry beside it.
core/test/diagnostics.test.js:45-75 — one test per name (:49, :54, :59) so a list entry that misses one cannot hide behind the other two, plus :67 pinning assign/compass/bypass, the existing x-api-key behaviour and the five-character bound. Both the header and JSON-body shapes are asserted per name.
Scope: compare f3b2be1e...27d0ffe8 is 1 commit ahead, 6 files — source + test, the docs line, the changelog fragment, and the two patches/ds-bot/* mirrors whose hunks match the core change. Nothing outside the fix.
Checks at the tip: all terminal runs success except enqueue-guard, whose only complaint is no Verifier report names the tip 27d0ffe86e2e — this comment is that report, so the check should pass on its next run.
The two name lists are still separate (capabilities.jsCREDENTIAL_NAME / withoutCredentialValues vs diagnostics.jsCREDENTIALS), synced rather than shared. Acceptable for this fix: they guard different surfaces (stored capability body vs report/log text) with different shapes, and a single shared regex would widen masking outside A sig / hmac / pass name is masked in a capability's status line but not in the log and the diagnostics report #3291's scope; the risk of re-diverging is now covered by name-pinned tests on both sides (capabilities.test.js:691 and here). A cross-list guard test would be a nice follow-up, not required.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A sig / hmac / pass name is masked in a capability's status line but not in the log and the diagnostics report
Fixes #3291
Owner: Dev-1
Reviewer: Reviewer
What was wrong
Two name lists promise the same masking and only one of them kept it.
capabilities.jsmasks a capability's own value undersig,hmacandpass(since #3278, pinned bycore/test/capabilities.test.js:691), but the list the diagnostics report and the downloaded log are cleaned with —CREDENTIALSincore/src/host/diagnostics.js— named onlyapi[_-]?key|authorization|x-api-key|password|secret. Measured on live mainf3b2be1eby runningcleanTextover the exact strings:X-Sig: abcdef123456→ unchangedX-Hmac: abcdef123456→ unchangedX-Pass: abcdef123456→ unchangedx-api-key: abcdef123456→x-api-key: [hidden]cleanTextis the one function the report and the downloaded log print through (diagnostics.js:206/:211), so a log line or a report row carryingX-Sig: <value>reached the user's own report whole while a line carryingx-api-key: <value>beside it was masked.Fix
One entry in the diagnostics
CREDENTIALSlist:sigandpassas whole segments, the same boundarycapabilities.jsuses, soassign,compassandbypasskeep their text;hmacis not part of an ordinary word and needs no boundary. Six characters minimum and quote-aware like the entry beside it, so a JSON body ({"sig":"…"}) is masked too and a five-character value is left alone rather than eating the words around it. Nothing else in the list changed and no name was added.Red first (each name independent)
The three tests were committed and run before the fix, on the same base
f3b2be1e:not ok 3 - cleanText hides the value of a sig header— actualX-Sig: abcdef123456, expectedX-Sig: [hidden]not ok 4 - cleanText hides the value of an hmac header— actualX-Hmac: abcdef123456not ok 5 - cleanText hides the value of a pass header— actualX-Pass: abcdef123456ok 6 - cleanText keeps assign, compass and bypass and leaves a five-character value— the boundary and the under-six bound stay green in the same run# tests 82 / # pass 79 / # fail 3at that commit;82/82after the fixOne test per name, so a list entry that misses one of the three cannot pass behind the other two.
Ran at the tip
cd core && node --import ./test/harness-resolve.mjs --test test/diagnostics.test.js→ 82/82TZ=UTC npm run verify→ exit 0: core 3424/3424, plane 25/25, social 758/758, tree 152/152, timeline 172/172, workflow 544/544, project 151/151,.github/scripts+policy 734/734, interop 37/37, live-e2e 34/34; oxlint 0 warnings, 0 errorsARCH_DOCS_BASE=f3b2be1e npm run arch-docs(incore/) →arch-docs: OK (6 changed file(s))node scripts/ds-bot-patches.mjs generatethencheck→ 10 patches apply cleanly,core/equalsds-bot/+ patches;canonical→ok patches/ds-bot/ is what generate writes (generate is a no-op)node .github/scripts/changelog.mjs check→ 2 fragments well formednode .github/scripts/check-mojibake.mjs→ 0 occurrences of U+FFFD in 1777 text filesNot run: the smoke test (the change is one regex entry in a pure text helper, no new endpoint or startup path), and the CI
packagejob's pack check, typecheck and actionlint.Tip:
27d0ffe86e2e96cadf8c1ea46848cb4d9c444bf0, tree19e5a5aee82d5aa82f6b6f9fb6f953fb81f1aa2c, base and merge-basef3b2be1ed045560749c5b277b57648217a429d00. Verified commitf78fce610aa39090b1f2aeb3959085d19b070196(same tree; the push path rebuilds the head from that tree on the live base), and every reading below was taken at it before the push.Checkpoint
{
"pr": 3292,
"claim": "Dev-1",
"issue": 3291,
"summary": "The diagnostics report and the downloaded log now mask a value written after X-Sig, X-Hmac or X-Pass, one CREDENTIALS entry with sig and pass bounded as whole segments so assign, compass and bypass keep their text and hmac unbounded. Six-character minimum and quote-aware, so a JSON body is masked and a five-character value is left alone. Three red-first tests, one per name, plus the boundary and under-six guards.",
"files": ["core/src/host/diagnostics.js", "core/test/diagnostics.test.js", "docs/subsystems/core-host.md", "changelog.d/3291.fixed.md", "patches/ds-bot/0001-core-fixes.patch", "patches/ds-bot/0007-version-and-tooling.patch"],
"checks": { "ran": "TZ=UTC npm run verify", "result": "green", "at": "27d0ffe86e2e96cadf8c1ea46848cb4d9c444bf0" },
"next": "ready for review at the pushed head"
}