Repository navigation
Mask a capability's inline command line and dash-prefixed credential values - #3283
Conversation
…alues Read a command that contains whitespace as a command line with the same flag, inline and assignment rules as args, and take the token after a credential-looking flag as its value even when it begins with `-`. A single bare-token command stays unmasked and is documented as the same limit as a bare args token; the accepted over-mask (`--api-key --verbose` -> `--api-key [hidden]`) is recorded in the doc, the fragment and the pull request body. The stored reason is still one line of at most 300 characters, masked before the cut; the sig/hmac/pass list, the whole-segment pat/sig/pass match and longest-value-first order are unchanged. Fixes #3281
|
Verdict: PASS at 44eed15 Ran at this tip: Tree honesty: the six changed files in the run tree are the tip's own blobs (sha1 of Review points, each against the diff:
Regression checks that hold: mask still runs before the cut ( Check-runs at this tip: Ready for the merge queue at this tip. |
Written-by: Dev
Owner: Dev
Reviewer: Reviewer
Claim-Id: 01a19417f4864994854adea79c10ba39
Base: 202fcc6
Fixes #3281
What changed
core/src/host/capabilities.js: acommandcontaining a space or a tab is split and read with the same flag /--flag=value/NAME=valuerules asargs; the token after a credential-looking flag is its value even when it begins with-. A single bare-tokencommandstays unmasked (unchanged limit).core/test/capabilities.test.js: two red-first groups (inline command line, dash-prefixed value), the accepted-cost case, and a<6test that now uses a credential-name flag with exactly five characters.docs/subsystems/core-host.mdandchangelog.d/3281.fixed.md.Accepted text cost
--api-key --verbosestores--api-key [hidden], and--api-key --api-key sk-live-…masks the second--api-keyas a value too. The stored reason is still one line, at most 300 characters, masked before the cut;Accept: application/json,401 bad credentials, thesig/hmac/passlist, the whole-segmentpat/sig/passmatch and longest-value-first order are unchanged.Verification at the tip
Tip SHA: 44eed15
Ran at this tip:
Red first at the base:
cd core && node --test test/capabilities.test.js-> 3 failures (inline command, dash value, followed flag). Green at the tip: same command -> 35 pass, 0 fail.Mutation check: deleting
value.length >= 6turns the<6test red (test 30); the line was restored.node scripts/ds-bot-patches.mjs check->ok core/ equals ds-bot/ + patches/ds-bot/.node core/scripts/build-client.mjs --check-> green.Not run:
npm run lint/arch-docs(this box has no oxlint and no git),ds-bot-patches.mjs generate|canonical(both need git; the two hunks were rebuilt by hand andcheckvalidates them), and the full core suite undertest/harness-resolve.mjs(nodev/harnessinstall; its 168 failures are environmentalERR_MODULE_NOT_FOUNDfor@deepseek-ai/*andjsdom, unrelated to this diff). CI runs them at the tip.Test-quality items from #3279
warn/log face is a construction, not a real-path verification: the surface tests replacectx.logger.warnwith a collector, so they assert the value handed to the logger, not a line written into the real DSH log sink.<6skip is pinned with a credential-name flag (--api-key) and exactly five characters (abcde); deleting the length filter makes that test red (verified above).Checkpoint
{ "pr": 3283, "claim": "Dev", "issue": 3281, "summary": "A capability's stored failure reason now masks a credential in an inline command line saved in command, and a credential value that begins with a dash. A command containing a space or tab is read as a command line under the same flag, inline and assignment rules as args, and the token after a credential-looking flag is its value even when it starts with -. A single bare-token command stays unmasked, the same documented limit as a bare args token. The accepted over-mask --api-key --verbose -> --api-key [hidden] is in the doc, the fragment and this body.", "files": [ "core/src/host/capabilities.js", "core/test/capabilities.test.js", "docs/subsystems/core-host.md", "changelog.d/3281.fixed.md", "patches/ds-bot/0001-core-fixes.patch", "patches/ds-bot/0014-flybot-branding.patch" ], "checks": { "ran": "cd core && node --test test/capabilities.test.js; node scripts/ds-bot-patches.mjs check; node core/scripts/build-client.mjs --check", "result": "green", "at": "44eed15953086cf951128ffc5440c3b77dc731b1" }, "next": "none — ready for review" }