Repository navigation
Keep this host's paths and keys out of room lines - #2700
Merged
Merged
Conversation
A room line is not local: fanoutRoomLine sends it to every other home in the room, so an unread picture must not name an absolute path of this machine and a crashed external Bot's line must not carry the child's stderr tail. The group placeholder now names the attachment by file name, media type and size only, the crash line reports just exit <code> or signal <name> and keeps the tail in rt.warn, and the store gate every writer already passes through runs this host's secret redaction before a line is kept or sent. Fixes #2699
Collaborator
Author
|
Verdict: PASS at ba4f8ce Ran at this tip: What I checked.
Not run here: Checkpoint block is compliant (1287 chars, summary 472, |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Written-by: Dev
Fixes #2699
Owner: Dev
Reviewer: Reviewer
What changed
A room line is fanned out to every other home in the room (
room-membership.jsfanoutRoomLine), so it may not carry this machine's private details.imagesForGroupused to handattachmentFilePath(...)toimagePlaceholder, so the far side readThe file is at "/tmp/…/attachments/v1/objects/ab/…"; your own file tools can open it.The group form (group: true) now drops the path even when one is passed in: it identifies the picture by file name (orsha256:prefix), media type and size, and says it could not be read. A Bot's own chat keeps the path, because that reader is this home's model and its own file tools can open it (Chat images cannot be read: the host has no vision model, and the placeholder hides where the bytes are #779).crashed (exit 1)orcrashed (signal SIGKILL); the child's last ~200 characters ofstderrgo tort.warn. Before,crashed (exit 1: Error: ENOENT: … open '/data/dsh/bot/home/state.json' token=ghp_…)handed the room this host's folders and whatever the child had printed. A spawn or stdin failure reports the crash without the reason too.room-context.jsprepareRoomLine, fromgroups.jsappendRoomandroom-membership.jsappend) now also runs this host'srt.redactSecretsbefore a line is kept or sent. It is wired once at install (setRoomLineRedactor), so no line builder has to remember.#1164/#2634semantics are unchanged:exit/closestill race with the first one winning,entry.reportedstill reports once, and a user stop still writes nocrashedline.Verification at the tip
Tip SHA: ba4f8ce
Ran:
cd core && TZ=UTC node --import ./test/harness-resolve.mjs --test test/room-line-leak.test.js test/images.test.js test/room-external.test.js test/session-identity.test.js test/room-context.test.js test/room-membership.test.js test/remote-room.test.js test/group-work.test.js→ 224 pass, 0 failcd core && TZ=UTC node --import ./test/harness-resolve.mjs --test test/private-files.test.js test/store.test.js test/room-context.test.js test/room-line-leak.test.js→ 54 pass, 0 failcd core && TZ=UTC node --import ./test/harness-resolve.mjs --test test/{agents,archive-bot,authz,automation-default}.test.jsone at a time → 16/6/21/14 pass (they aborted under full-suite concurrency, not from this change)node scripts/ds-bot-patches.mjs check→ok 10 patches apply cleanly in order/ok core/ equals ds-bot/ + patches/ds-bot/node core/scripts/build-client.mjs --check→ exit 0cd core && node dev/harness/node_modules/oxlint/bin/oxlint -c .oxlintrc.json index.js web-search.js src dev scripts test→ 0 errors, 87 warnings (all pre-existing)node .github/scripts/changelog.mjs check→ 35 fragments well formed;node .github/scripts/check-mojibake.mjs --check→ 0 occurrences;node .github/scripts/testing-layers.mjs --check→ every test file classifiedNot run (and why):
npm run verify(the whole suite) — the brief for this task says not to run it, and this machine has no gitnode scripts/ds-bot-patches.mjs canonicalandcore/scripts/check-arch-docs.mjs— both need git, which this machine does not have;patches/ds-bot/was rebuilt by hand (only added lines inside existing hunks, counts recounted) and proven withcheck's git-free applier, anddocs/subsystems/core-host.md(the page that ownscore/src/host/) is updated in this diffindex.jsor the browser sideRed first:
core/test/room-line-leak.test.js(4 cases, full-stack fixture with a remote seat andparseRoomShareover the wire bytes) failed 4/4 against the base implementation — the group line carried/tmp/…/attachments/v1/objects/ab/…and the crash line carriedopen '/data/dsh/bot/home/state.json' token=ghp_FAKE….Checkpoint
{ "pr": 2700, "claim": "Dev", "issue": 2699, "summary": "A room line is sent to every other home in the room, so it no longer carries this machine's private details. An unread picture in a group is named by file name, media type and size instead of an absolute path, while a Bot's own chat still names the path. A crashed external Bot's line reports only exit <code> or signal <name>, and the child's stderr tail stays in this host's log. Every stored room line also passes this host's secret redaction before it is kept or sent.", "files": ["core/src/host/images.js", "core/src/host/room-participant-external.js", "core/src/host/room-context.js", "core/src/host/groups.js", "core/src/host/room-membership.js", "core/test/room-line-leak.test.js", "core/test/images.test.js", "core/test/session-identity.test.js", "patches/ds-bot/0001-core-fixes.patch", "patches/ds-bot/0012-room-membership.patch", "docs/subsystems/core-host.md", "changelog.d/2699-room-line-leak.fixed.md"], "checks": { "ran": "node scripts/ds-bot-patches.mjs check; 12 core test files; oxlint; build-client --check", "result": "green", "at": "ba4f8ce1829ee4da7e30e6e62507e3106745e2bb" }, "next": "none — ready for review" }