Repository navigation
Conversation
Size Report
Startup median (7 runs, lower is better):
|
|
I found two confirmed gaps in the new ancestry rule at 02cfd69, and one docs claim that is wrong. CI is failing on the CodeQL alert described below, and there are no conflicts. The ancestry rule and the docs need to change before this can merge. The rule trusts a directory from its mode bits and group only. A symlink component can also bypass the rule. When the link's own parent is private, line 230 stats only the final target, and the walk continues up the lexical chain, so the ancestors of the real target are never checked. With The docs misstate sticky semantics. replay-e2e.md:75 says a sticky team directory is safe, but the directory's owner can still rename and remove entries. Line 74 and Not blocking, take or leave: the local writer runs The CodeQL alert on the quadratic Before merge, the ancestry rule should trust only directories owned by you or root, follow the resolved chain of any symlink, and the docs and hint should match. The CodeQL alert should be cleared too. |
3f17db5 to
450a915
Compare
|
Thanks for the update. At 450a915 the CodeQL alert on the trailing-slash regex is gone, and all 21 checks pass. Two defects remain in the destination checks, and there are no conflicts. Both are traced from the source. The new rule no longer judges every directory the path traverses, so atomic-file.ts:278 accepts destinations that the earlier revision refused. The spelled walk skips every component that is not a link, and the realpath walk covers only the final resolved chain. For example, take The remote client refuses a path the local writer accepts. session-script-destination.ts:206 runs assertPrivateScriptDestination before the missing parent is created at :207. For Not blocking, and you can take or leave these: the test at atomic-file-ancestry.test.ts:661 is named 'admits it with root named among its members' but asserts The code-scanning thread on the trailing-slash regex no longer applies, because the regex is gone at this head, so please resolve it: #4584 (comment) |
|
Head Traversed directories. Remote ordering. The remote client judged the chain before Groups. Scope of the claim. No ACL code. ADR 0016, the guide, and the remote page now name macOS and POSIX ACLs, network filesystems and mounts as outside the guarantee, and the unconditional confidentiality line is gone: the file is written Hardening. The source-text check for the publisher entry point is deleted; the writer tests drive a real write and expect the typed refusals, so they cover dispatch by behaviour. The Checks: |
|
Thanks for the update. At 546303c the link to a last-component target such as First, Second, link stability is asked only by Third, Could one component walker replace The The github-advanced-security thread on the trailing-slash regex no longer applies: Not blocking, take or leave: the four-line comment at The shapes above were probed against the head Before merge, the two link walks need to become one kernel-lookup walk that judges every looked-up directory and every followed link, with the three regression shapes added and the Fallow audit passing. |
7041497 to
4964b44
Compare
|
Yes — one walker replaces all five, and it is now the only thing that resolves a destination. Head: The one loop, and what it cost.
The three shapes, at all three levels. Each is refused at
Two hardening items rode along: the hop count is refused as The group exception fails closed. It is admitted only where The unused configurable Fallow. Checks. CI is green at Reverting only |
|
Thanks for the update. At 4964b44 the Fallow failure from the earlier round is fixed and all 21 checks are green. The quadratic trailing-slash regex is also gone from
Not blocking, take or leave: the Shape 2 (a foreign-owned hop link in a sticky directory) was traced from the code only, because an unprivileged process cannot create it. The probe confirms that 546303c accepts shapes 1 and 3. The change is 715 net production lines, just over the usual size line. There is no smaller owner beyond the two cleanups above. Before merge, the relative-target walk must be fixed with regressions, and the duplicate lstat helpers must go. |
|
All five are in. Head: 1. The relative target. 2. Staging escaped the judged directory. Two consequences worth naming. The parent identity is compared against 3. 4. A bare destination. 5. Judged once. Also folded in: One thing the first push broke, and a fourth shape it exposed.
Delta. Checks. Reverting the five production files to |
This comment has been minimized.
This comment has been minimized.
93156c8 to
49ada50
Compare
|
All six are in. Head: 1. The relative destination (blocker). 2. The test file is split. 3. The alias test now walks two routes. 4. The temp predicate compares directories, not spellings. Two things were wrong: it compared path text, and it used 5. The three writer tests ask about one directory. All three now call 6. Delta. This round is production Checks. |
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 49ada50. The verdict and the full list are in the summary comment.
49ada50 to
7ed8e26
Compare
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 7ed8e26. The verdict and the full list are in the summary comment.
|
All four review items plus both review threads are in. Head: 1. The two 2. The walk no longer trusts Node's remembered working directory, and both publishers create the entry in the judged directory.
Tests, all through the exported publisher: 3. 4. The hop test states its numbers. A 30-link chain publishes, a 31-link chain is refused naming 5. Missing parents are refused before they are created, on both routes, with the same walker. Remote entry path ( Wire ledger. One split rode along. The new host-kit cases pushed Delta. Production Checks. |
|
I reviewed d86ee29 and found two problems to fix before merge. Compared with the earlier review, the shared-ancestor and spelled-destination issues are fixed. The 20 CI checks pass at this commit, and there are no conflicts. The docs promise that a refused save leaves no directories behind (see replay-e2e.md and ADR 0016), but the code does not keep it. Both routes create the missing parent with no mode: session-script-writer.ts:144 and session-script-destination.ts:208. Under umask 002, the new directory is 0775. Without an admitted private group, the check that runs right after the mkdir refuses it as nameServiceListsOnlyFiles admits only Open threads: neither earlier inline thread still applies, so please resolve both. shared ancestor before mkdir is fixed by the prefix check before the mkdir (the leftover under umask 002 is the first problem above, a different mechanism). publish destination spelling is fixed because publishStaged now creates the file under the directory judged under the lock. The walk itself is justified, since a per-component O_NOFOLLOW open cannot carry the create without openat. Production code grew from about 715 to about 875 net lines across five files, and the growth is patches around the walk. Would these cuts make it smaller and better owned? (1) Both callers already resolve an absolute destination, so could host-kit refuse a non-absolute one at its entry and delete the cwd branch of Not blocking, take or leave: the relative-destination half of absoluteParent cannot fire from production because both callers pass absolute paths, and the publishScriptFileSync JSDoc at line 53 still documents the removed The Ubuntu case comes from tracing the code and a macOS umask-002 reproduction, not a live Linux run. Before merge, please create missing script parents at 0700 on both routes with the umask-002 regressions, and decide the private-group exception for stock Ubuntu. |
d86ee29 to
c852884
Compare
|
Redone as one smaller rule, with ADR 0016 amended to match in Blocker 1 — created directories now pass the rule they are judged by. Same sequence at this head: the save goes through and both new levels are Blocker 2 — the private-group exception is dropped, not widened to That is a project directory at The four smaller-design questions
Also from your not-blocking list: the stale Lines. Measured your way — net added over Checks. One thing to flag for your judgement, since it is a user-visible change I made under decision 3: a local Both inline threads were already resolved, so there is nothing to close there; I added a short note to each saying which change answers it. |
|
Thanks for the update. At c852884 the two earlier threads on the shared ancestor and the publish destination are fixed, but one new problem remains: a umask-002 daemon host now refuses its own default recordings. The daemon creates The rule to satisfy: every directory that agent-device creates on the chain of a script destination it chooses (state dir, Not blocking, and fine to take or leave: The finding above comes from a code trace plus a Node mode reproduction of the two daemon mkdir calls. No live umask-002 daemon run exists yet. The rule no longer reads account databases, so the Ubuntu outcome depends only on directory modes, which the test All 21 checks pass at c852884, but CI hosts use umask 022 and explicit 0700 test homes, so they do not reach this route. There are no conflicts. Before merge, The open inline threads on the shared ancestor before mkdir (#4584 (comment)) and on the publish destination spelling (#4584 (comment)) are fixed at this head, so they can be resolved. |
|
Head The daemon's own directories (your blocker). lstat versus stat (blocker 1). Every step is judged from the Recursive mkdir (your item 2). Pass-through. Delta. Net production across the five files this rule owns is +926 (was 735 at Checks. One caveat on that last test, so the count is not read as more than it is: eight of the nine new or rewritten tests go red at ADR 0016 and the guide now state one |
|
Thanks for the update. At 235d0db, the regex on the destination is gone, the walk now runs before any creation, and staging is allocated in the judged directory, so those parts of the earlier review (#4584 (comment)) are fixed. One finding remains. The remote route copies host-kit's refusal instead of calling it. Not blocking, and you can take or leave these: ADR 0016 :227 still says the remote pre-rename comparison is the only identity comparison, while :222 and the code re-check identity on every walk, so one of them needs to change; Could the change be smaller? The two fixes that carry the safety are judging every step from its single lstat, and creating each missing level with one non-recursive mkdir that judges an appeared entry by the same rule. The identity-compare and 'replaced' branch in The three earlier inline threads are fixed at this commit and can be resolved: the polynomial regex (#4584 (comment)), creation before the walk (#4584 (comment)), and staging outside the judged directory (#4584 (comment)). CI shows 20 checks with 0 not passing at 235d0db. The CI hosts run umask 022, so the umask route is covered only by the |
235d0db to
45d4eb9
Compare
|
Cut the recognition layer rather than defend it — head Blocking finding: routed through one exported host-kit call. One placement difference from your suggestion: the confirm runs after the download and before the rename, not in What was cut. Your ownership argument is the reason the layer is gone rather than the reason it stays, so it is gone — the whole thing, not a part:
I could not name an attack that layer caught which the ownership rule lets through, and I could not reproduce one against the pre-cut code. Every actor able to swap a judged directory had already been refused at it: a level the walk stands in is owned by this user or root with its contents closed to others, or is sticky, where this user's entry cannot be replaced. Nothing here was kept for a reproduced attack, and I found nothing whose removal reopens one. −96 production lines in this commit; What was kept, and the scenario each one answers.
Daemon state repair: yes to both, and named. Tests for it:
ADR 0016. The delta, reconciled. Our counts differ only in which files count as test files. Under the rule your numbers use (everything except
Why the total did not follow If the total still needs to come down, the honest split is by concern, not by deletion: the ancestry rule ( Red at Checks at Two things your comment names that this head does not claim to fix: CI still runs umask 022, so the shared-checkout route is covered by the |
There was a problem hiding this comment.
Apex Sentinel: 3 new findings on 45d4eb9. The verdict and the full list are in the summary comment.
|
Thanks for the update. At 45d4eb9 the host-kit changes close the earlier destination concerns, but one new problem remains: the daemon can now refuse to start on setups that work on main.
The rule the code must satisfy: a state-mode repair never decides whether the daemon starts. It forces 0700 only on a directory entry this uid owns, reached without following a link. Otherwise it changes nothing and emits Could the repair be the smaller design above? The host-kit cut helps: Not blocking, take or leave: the comment at atomic-file.ts:916 says the created level "would stand 0775" without the chmod, but The three earlier inline threads no longer apply, so please resolve them: no regex runs on the destination at 45d4eb9 (#4584 (comment)); Checks: 20 pass and one review check is still running; no failing job overlaps the diff. CI hosts run umask 022 as a uid that owns its temp dirs, so the symlink and foreign-owner shapes only run through the simulated-ownership test, which asserts the refusal. The startup problem comes from the code and the pinning test, not a run against a symlinked Separately, on main, |
45d4eb9 to
4b630c1
Compare
|
Folded in as three commits on top of the host-kit round: The rule, in the ADR before the code (
Both setups you named are pinned as startup tests, not unit tests: a Creation of missing state levels keeps the plain recursive The other cuts from the cross-check: ADR walk counts are stated: remote walks twice per version where the parent stands, three times where a level has to be created, one identity comparison either way; local walks once, twice with a missing parent, compares nothing. Net production is +1,022 (676 code, 380 comment; excluding tests, Disclosures carried over: the suites run under umask 022 and foreign ownership is a fixture uid (65534), so neither CI's umask nor a real second account is exercised on real ids; and |
… half Splits PR #4584 down to the rule its reviewer asked for: the destination a caller names with `--save-script` is judged before anything is created. The daemon's own state-directory chain is removed from this change and moves to #4649, which folds in #4620. Kept: the walk of a caller's destination (one `lstat` per step, links walked, `..` applied to the physical directory, a hop limit), per-level non-recursive 0700 creation that refuses before creating anything, absolute paths only, 0600 script files, and the remote client route answering the same rule. Removed: the umask self-refusal, `ensurePrivateDaemonStateDir` and its chain repair, the chain verdict and `state_chain_untrusted`, the one-spelling rule, the own-state fallback, and daemon-state 0700 creation. Daemon-picked destinations take `main`'s behavior and skip the walk, and the files that only served them come back exactly as they are on `main`. Restored, as a read-only walk check: the private-group exception. A group-writable directory is accepted only where the caller owns it, its gid is that user's primary group, no group record with that gid lists another user, no other account claims that gid, and name services resolve accounts from local files alone. A stock Ubuntu home is therefore usable; `ldap`, `sss`, `nis` or a missing `/etc/nsswitch.conf` keeps the refusal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reduced route had carried two shortened strings: the no-clobber hint dropped which flags replace the file, and the repair-commit hint dropped the recovery a caller takes next. Both are user-facing text the reduced change has no reason to touch, so they keep the words they have on `main`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The gate's typecheck project covers the suites that `tsc -b` alone left out, and two of its findings were real: the gid a fixture directory inherits was kept private while a sibling suite reads it, and a fake daemon could not answer a request through the client's own materialization step, which is where a hostile response is actually handled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The eager-closure gate failed 65 façade entries: the account-file reader lived in a module none of them evaluated, so an app-log reader paid for parsing `/etc/passwd`. The gate's tolerance is for a statement-neutral split, and ADR 0027 gives growth no approval path, so the fix is the one it names — the new code goes to a module every affected entry already evaluates. `internal/owner-identity.ts` already answers who this process is on the host, is in the merge-base closure of all 64 entries that reach the walk, and had room under the 1,000-line cap. The reader keeps its name, its host seam, and all 20 cases; the tests move with it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
b9d6f76 to
c4fa0ce
Compare
Reduced to the caller's destination ruleSplit as agreed. Force-pushed with lease: head What this head carries. Only the rule a caller's What left. The umask-002 self-refusal, The #4565 exception is back. A group-writable directory is accepted where the caller owns it, its gid is that user's primary group, no group record with that gid lists another user, no other account claims that gid, and One thing worth knowing before you read the diff. The account reads first lived in their own module, and Size, stated plainly. The net production delta is +1,087 lines (1,151 added, 64 removed) across 8 files, against +1,356 across 13 files on Checks. Outside this PR, found on the way. 🤖 Generated with Claude Code |
This comment has been minimized.
This comment has been minimized.
…rship The private-group exception asked whether any other user holds a directory's group id, and answered it from /etc/passwd and /etc/group. Those files are not the whole answer on a systemd host: systemd-userdbd serves users and memberships they never show, so `files systemd` in nsswitch.conf is not evidence that the group files are complete, and an unseen user can hold the gid. Reading the account files also made one destination answer differently per host, which no other part of this rule does. So the mode decides again, on every host: a group-writable ancestor that is not sticky is refused as `shared_group_writable`, and the hint names the directory and `chmod g-w <dir>`. Owner, sticky and root rules, per-level 0700 creation, refusal before creation, and 0600 files are unchanged. - owner-identity.ts returns to main; its private-group reader and its 21-case suite are removed, along with the account-file seeds only that probe needed. - atomic-file.ts no longer carries a group-membership probe, and DirectoryAuthority no longer carries a gid nothing reads. - A test now proves the judgment reads none of /etc/passwd, /etc/group or /etc/nsswitch.conf, so a host dependency cannot return unnoticed. - The hostile-daemon artifactId case asserted a field shape production never answered, so it never ran. It now asserts the string destination, the bytes and the absence of scriptDeliveryFailure, per name and per world; four mutations (dropped delivery, steered destination, steered-and-quiet, write at a stray name) each fail it. The source also carried a raw NUL byte, which made git report a .test.ts file as binary. - test-kit's host-ownership fixture loses the descriptor tracking, the three descriptor spies and HostOwnershipProbe, which no test used. Refs #4565
Private-group exception dropped, per #4565 discussionHead Why it goes. The exception asked "does any other user hold this gid?" and answered from This also fixes the Linux CI failure that started the investigation. Fixture orphans removed. The hostile-daemon assertion was dead, and is now live. Production answers Proven by mutation, each failing the case and then reverted byte-identically:
One file was unreviewable. A second defect, still out of scope and untouched by this PR:
Generated with Claude Code |
This comment has been minimized.
This comment has been minimized.
|
Reviewed at 80bc212. The earlier findings from 5165fdb (#4584 (comment)) are mostly fixed: the state-repair and tombstone changes are gone, and the walk and 0600 publish now live in host-kit. One problem remains, and it needs a change before merge. The new delivery-cause set in session-script-publication-capability.ts:34 ( Could the rest of the change shrink by about 300 lines with the same host-kit rule? I see: one walk loop that throws the Not blocking, take or leave: the Two gaps in the hostile-daemon tests also need fixing before merge, because this is a remote-session change. They are not production bypasses. First, the hostile publication-ID, failure-text and mismatched-publication cases in daemon-artifacts-script-hostile-daemon.test.ts (:98, :214, :248) send Four open inline threads are fixed at this head and can be resolved, because those files now match main: the launchDaemonProcess ENOENT (#4584 (comment)), the ensureSessionDir stop (#4584 (comment)), the tombstone spelling split (#4584 (comment)) and the trailing-slash state-dir latch (#4584 (comment)). The arbitrary-reason gate thread (#4584 (comment)) is addressed by the cause set, but that set is the problem above, so it can be resolved once the set is removed. The foreign-owner cases are simulated by spying on lstat/stat uids, so the sticky-bit and ownership guarantees rest on POSIX semantics rather than a run with a real second user. ACL, network-mount, bind-mount and systemd-userdb hosts are documented as out of scope and untested. The four Smoke Tests jobs (two plain, iOS and macOS) were still running or queued, so they have not failed. They barely touch this change, since they use no explicit script target. There are no conflicts. After the daemon cause set is removed, those Smoke Tests jobs need to finish green before merge. |
The daemon named a delivery cause it could never have found. The cause set read the daemon's own error reasons, and the only route it saw is the daemon-picked remote path that runs no destination walk, so an EACCES or an ENOSPC in its own state directory was disclosed as script_download_failed and a client was sent to fix its ground for nothing. The cause now comes only from the client that found the failure on its own filesystem: session-script-publication-capability.ts and session-close-script.ts return to main, and the two tests that mocked a refusal a remote session cannot produce go with them. Receipt cases sent a `wait` request, and the client reads a receipt only on a batch, so the validator was never reached. They send a real batch now, the mismatched-publication case names a second publication this same client owns so a bypassed validator writes into it, and a matching receipt publishes through the same seam to show the seam is honored at all. The tree is snapshotted whole, `state` and `caller` included, so nothing a response named can appear unasked for. Every case is proven to fail under a mutation. The rule loses lines it carried twice: one walk loop that throws where it refuses, long judgments replaced by one-line ADR 0016 pointers, one prepareScriptDestination with one Windows branch, and the destination-ancestry publisher reusing publishFileSync. The device-and-inode temp-sibling comparison leaves production for the fault-injection support that needed it, which is also where its two cases go. The empty parent_replaced wording, the dangling createStateLevels link, and the dead lstat branch are fixed, and the docs now say the check guards every local route that names a script file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4d994ee to
e122458
Compare
|
Third round pushed as The daemon cause set is gone. Two hostile-daemon gaps are closed, with mutation proof. The receipt cases sent a The rule lost lines it carried twice. One walk loop that throws where it refuses, instead of a Docs now say the check guards every local route that names a script file, not just |
|
Reviewed at e122458. The earlier findings from #4584 (comment) are fixed: both daemon modules match main, the receipt cases are real batches with a positive control, and the walk refactor keeps every refusal rule. A separate security cross-check found no bypass by another local user or a hostile daemon. Three small items remain before the label, listed below. Also apply these notes: the mismatched-publication test in The five earlier inline threads no longer apply, because those files have no diff against main at this commit, so please resolve them: #4584 (comment), #4584 (comment), #4584 (comment), #4584 (comment) and #4584 (comment). The foreign-owner and sticky-bit guarantees are still exercised by spying on lstat uids, not by a run with a real second local user, and ACL, network-mount and bind-mount hosts are documented as out of scope and untested. The Coverage job failed on one test, the coordinate errorTaxonomy case in Before the label, please fix these three items:
|
This comment has been minimized.
This comment has been minimized.
The shared publisher chmod'ed every asked-for mode, so a caller that passes `mode` now got the exact number where main gave it the mode ANDed with the umask: 0600 under umask 0200 became 0600 instead of 0400. Daemon-picked remote scripts and every other generic caller are meant to be unchanged by this PR, so the generic route pays the umask again and only the caller-script publisher asks for the number, through `exactMode`. Both sides are pinned: a generic caller at umask 0200 answers 0400, a caller script answers 0600, and dropping either half of the split fails the case that names it. The hostile-daemon suite now watches a tree the client is planted DEEP inside, so a `../../../../` name lands where the snapshot can see it instead of in the system's scratch directory, and it snapshots WHAT each entry IS — bytes, link target, kind — so a steered write through an allowed name is reported rather than allowed by its name. Records are matched by exact name and by the fields they carry, not by the shape of their digest. Four mutations fail the new oracle: an extra record of the client's own shape, one appended byte in a published file, a write outside the scratch root inside the watched tree, and one above it. The rule loses the rest of its duplicated wording: the `short` refusal lives in the walk alone, which now creates what it stopped below and judges the completed chain, and test-kit's temp-sibling predicate asks host-kit's `isAtomicPublishTemporaryPath` for the name half. The mismatched-publication case sends once, the dropped-receipt case says what it now asserts, and the docs name the ancestry refusal, the sticky exception in the group-writable sentence, and caller-named destinations. Refs #4565 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Reviewed at 1. Daemon-picked mode behavior. 2. The external-write check. The scratch root is now planted at 3. Docs wording. All four: the group-permission sentence says a directory must prevent other users from modifying entries in it; the sticky-traversal exception is restated inside the group-writable refusal; the no-directories claim is scoped to a destination the ancestry check refuses; the routes sentence names caller-named destinations and says where no path is named at all, the daemon writes its own default location without this check. The four notes are applied. The mismatched-publication case sends ONE batch, because nothing in that answer depends on a hostile string. The dropped-receipt case is retitled to what it asserts, and it now asserts
The five inline threads you listed are resolved. The foreign-owner and sticky-bit guarantees are still exercised by spying on 🤖 Generated with Claude Code |
The hostile-daemon cases read the expected record name from the record directory AFTER the delivery they judge, in both places that name matters: `ownRecordFiles` built the allowed list from a fresh listing, and the expected `name` came from `recordNames(world)[0]`. A client that renamed its own legitimate record to another hash-shaped name after publishing therefore handed the assertion its own new name, and the rename passed. The pin now comes from before the answer — `recordNames` at that moment, or the fixture's `recordsAtSend` — and the same pin feeds both assertions, so an added or renamed record is reported instead of accepted. `recordsAsWritten` compares the current listing to the pin first, so a moved record fails as the name it moved to rather than as a missing file. Proven both ways with one mutation: after all publish work finishes, rename the record to an unrelated hash-shaped name. Against the previous head that fails 1 of 7; against this one it fails 5. Refs #4565 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Fixed at
Proven with the rename mutation. After a publish has finished all of its work — bytes in place, staging released, record written at its final fields — the client's own record file is renamed to an unrelated hash-shaped name, and nothing else about it changes. Against
🤖 Generated with Claude Code |
This comment has been minimized.
This comment has been minimized.
|
The code is ready at ecb174e: the findings from the earlier review (#4584 (comment)) are fixed, and a separate security cross-check found no redirection by another local user or a hostile daemon. One docs sentence needs a fix before the label, described at the end. Not blocking, and you can take or leave these: the new Before the label: replay-e2e.md:74 says, without qualification, that the script file is created at mode 0600. That is exact on the local caller-script route, because |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Ready at 723941b. Against ecb174e, this head changes only docs and one test helper (3 files, +13/−6). The one remaining item from the earlier review (#4584 (comment)) is fixed. replay-e2e.md now states exact |
Apex Sentinel · ✅ Approve · review of
|
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
Closes #4565.
open --save-script=<path>resolved the destination by name. A second local user who could write any directory on the way to it could replace that component, or leave a symbolic link there before the entry was created, and move the recording wherever they chose. Both the local writer and the remote staging path had it.Node exposes no
openatorrenameat, so a publisher cannot resolve a destination relative to a verified directory handle, and no re-check closes a race with a local attacker. The window is closed by permissions: a destination is accepted only when no other non-root local user can modify any directory the publish traverses. Every directory the kernel steps into is judged, not only the final real path, since a plain directory under a shared one can hold a link into a private destination...is applied to the directory the walk reached, not to the text.A destination is refused under
script_ancestor_untrustedwhen a traversed directory is owned by neither you nor root, is writable by other or by its group, is where the entry would be created while others may add entries, or holds a link another user could have planted. Missing levels are created one at a time at 0700, and a refused destination creates nothing.A group-writable directory is refused whoever owns it, with a
chmod g-whint. An earlier shape accepted one whose group looked private to this user; that is dropped. Membership cannot be proven —systemd-userdbdanswers memberships/etc/passwdand/etc/groupnever show, so an unseen user can hold the gid. Under umask 002 a directory you create is group-writable and is refused until youchmod g-wit.ACLs, network mounts and mounts over a checked directory sit outside the rule: it says no other local user can steer where the recording is written, not that nobody can read it.
Scope. The rule judges a destination a caller names. Destinations the daemon picks for itself keep
main's behavior byte for byte; #4649 decides that chain separately.Size. Production source is +687/−62 over 6 files (+625 net), most of it the host-kit walk. No new flag, command, state name or wire field.
🤖 Generated with Claude Code