Repository navigation
search: the redaction fast path lets through every text sessionpipe-core 0.19 redacts - #277
connorburgess wants to merge 4 commits into
Conversation
…ore 0.19 redacts Symptom: with sessionpipe-core 0.19.1 (the bump in spacesheep-dev#271), the search index keeps `Cookie: sessionid=…`, `curl -b 'sid=…'`, `GET /x?sig=…`, `fetch('/dl?X-Amz-Signature=…')` and `{"name": "Authorization", "value": "…"}` as they are, while core's own redactSecrets cuts each of them. On main (core 0.17.0) core redacts none of them, so nothing leaks today. Cause: redact() skips redactSecrets when MAYBE_SECRET finds no trigger and the ruleset id is secrets@1. Core 0.18 added cookie, named-value and link-query rules under the same id (f31fc51, 556a8c0, c410cf4), and none of their words is a trigger. redact.test.ts's guard counts only TOKEN_PATTERNS, which did not change, so it passes on 0.19.1 too. Fix: MAYBE_SECRET also takes `cookie`, `authorization`, `-b ` and the query keys core reads after `?`, `&` or `&` (`k`, `sig`, `signature`, `x-amz-signature`, `x-goog-signature`; `key` was one already), and the Kelvin sign, which core's lower-casing turns into `k`. A text with `name` and `value` beside a cookie attribute takes the full path too. redact.test.ts gets a sample of every rule 0.18 added (parity only: 0.17.0 leaves them alone) and pins the core versions the list was checked on, so the next bump has to look at it. Signed-off-by: Connor Burgess <connorburgesscodes@gmail.com>
Signed-off-by: Connor Burgess <connorburgesscodes@gmail.com>
Signed-off-by: Connor Burgess <connorburgesscodes@gmail.com>
|
The redaction fast-path compatibility fix for core 0.19.1 still applies to SessionPipe GUI v0.8.18. Merged current Added the previously deferred Unreleased changelog entry. Validation on this head, macOS / Node 22.23.2:
GitHub CI run 47453784345 for head The desktop shard 3 failure is d16a2c01, npx playwright test test/e2e/split.spec.ts --project=desktop --grep "covering the page locks" --repeat-each=6 --workers=2 reproduced four first-attempt failures; all four passed on retry, with two other repetitions passing initially. This establishes baseline flakiness, but does not turn the failed PR run green.
A maintainer needs to rerun the failed job (and aggregate gate), or resolve the baseline flake, before merging. The job-rerun API rejected this account with HTTP 403: “Must have admin rights to Repository.” Also checked the combined source/test changes from all 19 refreshed PRs on the same main: no source conflicts; typecheck, lint and build passed; all 252 unit-test files passed (3,439 tests, two skipped). This was a local integration check, separate from the individual PR run above. Release-note entries may still need combining as PRs land. Additionally tested against |
Signed-off-by: Connor Burgess <connorburgesscodes@gmail.com>
|
Merged current CI run 47499579175 for head It took three runs on this head to get there, and I closed and reopened the PR twice to start them, since I cannot rerun jobs here. The two failed runs, and the one on the previous head, each failed a single browser test, none of which this PR touches (it changes only
Locally on |
Updated against v0.8.19 / main
e8bfe999on 2026-12-05. Current validation and refresh details.What
Search's redaction fast path (
server/search/sources/text.ts) now sends every text that sessionpipe-core 0.18 and later can redact throughredactSecrets. Those versions added cookie, named-value and link-query rules under the same ruleset id,secrets@1. Once the core bump in #271 lands, the search index will no longer keep a cookie or a?sig=value that core itself removes.On main today nothing leaks: the pinned core 0.17.0 does not redact these texts, so skipping them changes nothing. This PR gets the fast path ready for #271 and does not bump the dependency.
Why
redact()skipsredactSecretswhenMAYBE_SECRETfinds no trigger andRULESET_SECRETS === "secrets@1". Core kept that id while adding text rules:Cookie:,Set-Cookie,HTTP_COOKIE,--cookie, curl's-b '…',added cookie …), plus avaluenamedAuthorizationor a cookie in an object ({"name":"sid","value":"…","domain":"…","path":"/"},addCookies([…])).?k=,sig,signature,x-amz-signature,x-goog-signature, after?,&or&).None of these words was a trigger. With core 0.19.1, each of the 16 samples now in
LATERin redact.test.ts is changed byredactSecretsbut was skipped by the old fast path. The guard "is bound to the ruleset" counts onlyTOKEN_PATTERNS, which those commits did not touch. That is why it passes on #271's CI run.Triggers added, chosen to be the narrowest that still match core:
cookie,authorization,-b\s(?:[?&]|&)(?:k|sig|signature|x-amz-signature|x-goog-signature)=(keywas already a trigger). Baresigwould match "signal" and "design", so it is not a trigger.k, so"cooKie"written with it is a cookie key to core.name,valueand one ofdomain|path|expires|httponly|secure|samesite. Core needs anameorkey, avalueand two attributes, so this check also lets through some texts core would leave alone.The test changes:
LATERholds a sample of every text rule 0.18 added. Only parity with core is asserted for them, because 0.17.0 leaves them alone.LATER.0.17.0,0.19.1). A later bump has to add its rules' samples and its version.When #271 rebases onto this, it needs no change here: 0.19.1 is already on the list.
An entry is now included under Unreleased in
CHANGELOG.md. Other open PRs also add release notes; those entries may need combining as the PRs land.Original proof (before the v0.8.18 refresh)
I ran redact.test.ts on both core versions, with and without the fix. Core 0.19.1 was installed only in a scratch copy of the tree; package.json and the lock file are unchanged.
text.tsThe failures with main's
text.tson 0.19.1:The other checks:
(On an earlier run of this branch,
server/control/remote.parity.test.tsonce hit its 15 s timeout while the whole suite was running. Run alone it passes, 11 tests, on main and on this branch. It does not touch search.)Checklist
git commit -s): the DCO is the only paperwork.npm run typecheck && npm run lint && npm testpass;npm run test:e2efor a UI change. (No UI change.)// SPDX-License-Identifier: Apache-2.0. (No new files.)--demo). (The samples are generated strings.)shared/*names the wire-contract change in the description. (Noshared/*change.)CHANGELOG.md.