Repository navigation
/cso audits repositories that track symlinks, without following them (#4540) - #4567
Merged
Merged
Conversation
…4540) Each tracked or nonignored symlink is recorded by its target string and never followed; FIFOs, sockets and devices are still refused, and --paths now limits the special-file walk to the audited directories. Co-authored-by: nathanshox <[email protected]> Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
…g it The secrets check read the fixture key 'passwd' pointing at /etc/passwd as a password assignment. The link is now named 'host-users'; the test is unchanged. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
A tracked link whose target held a credential had the raw value copied into the report next to its redaction marker. The path a link resolves to is now redacted and quoted, so it can neither leak a secret nor read as extra report sentences. Review-Finding: p1/specialist-batched#1 reader=security Review-Finding: p1/red-team#3 reader=red-team Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The redactor misses a key=value secret that follows a slash, so a link target such as ../password=<value> still reached the report. Each segment is now redacted on its own and the in-repository path is built from that redacted target. TODOS.md records the symlink design as decided. Review-Finding: p2/red-team#1 reader=red-team Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Redacting each path segment on its own hid the URL context the credential detectors need, so a target like postgres://user:<password>@host/db, or a secret containing a slash, could still reach the report. A target that matches any secret pattern, whole or per segment, is now withheld and no path derived from it is shown. Review-Finding: p3/outside-voice#1 reader=outside-voice Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The troubleshooting page, the changelog entry and TODOS.md said every link is listed with its target string; a target that matches a secret pattern is withheld instead. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Merged
capy-ai Bot
added a commit
that referenced
this pull request
Nov 20, 2026
- Two /ship approval records stop needing workarounds. (#4549) - For contributors: the paid auto-decide check counts a start step that ran while the skill loaded. (#4543) - The destructive-command check closes three ways past its disk-wipe and force-push blocks. (#4534) - A green CI run still counts when the repository's artifact storage is full. (#4536) - `/cso` now audits repositories that track symlinks. (#4567) - A doc-sync eval stops failing when the audit child drops one field from its result line. (#4555) - The browse daemon no longer picks port 10080, which Chromium refuses to open. (#4554) - Opted-in telemetry now says why a skill run ended, which coding agent and model family ran it, and whether an upgrade worked. (#4542) - A preregistration with only its write-up and plain data now gets the write-up review: one reviewer, one round. (#4544) - When owner rulings don't clear a stopped review, `gstack-review-read` now says which findings are left. (#4553) - The prompt-routing hook now names your installed bug-fix skill on bug reports, alone, and never puts /verify ahead of it. (#4539) - Owner rulings now close a stopped review whose findings were logged in a findings file. (#4568) - /ship can finish after the owner accepts a stopped review's findings as open notes. (#4552) - /ship no longer starts the full test suite on your machine when CI's earlier run can't be reused (GST-3277). (#4565) - The prompt-routing hook no longer acts on words inside backticks. (#4566) - In Claude Code, a gstack skill's start step now runs when the skill loads, so the model can't skip it. (#4509) - gstack's telemetry backend only accepts writes through its own validated endpoint, and the community dashboard now counts real use. (#4537) - gstack now says what it's adding before it adds a background job or a browser extension. (#4538) - For contributors: every flaky pass in Free Tests is now recorded. (#4572) - For contributors: Free Tests on pull requests starts its test shards one round of small jobs sooner. (#4570) - Secret values written as `name=value` at the end of a path are now hidden. (#4571) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Contributor
|
Follow-up landed in #4592: /cso now checks every folder above a source path, from the repository root down, before it looks at the path itself. A tracked file under a folder that was swapped for a symlink now fails closed with |
3 tasks done
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.
/csono longer stops on a repository that tracks a symlink, such as gstack's ownconnect-chromeorCLAUDE.md -> AGENTS.md: each link is listed in the report by its target string, or as withheld when the target matches a secret pattern, and it is never followed.Why: a security audit that refuses ordinary repositories audits nothing, and following a link would let it point the scanner at
/etc/passwdor out through...Nothing to do. FIFOs, sockets and devices are still refused, and
--pathsnow limits that check to the audited directories.What changed
Running
/csoon almost any real repository used to fail withUNSAFE_PATHthe moment it met one symlink; 5 of 8 mid-size open-source repositories we measured stopped there. Nowlib/cso/snapshot.tsreads each tracked or nonignored link withlstatandreadlinkonly, binds it by device, inode, mode and target bytes, and records it as an exclusion that names its target and says, from the text alone, whether it is absolute, escapes the repository, or names a path inside it. Nothing stats, resolves or opens through a link, so a link to/etc/passwd,/dev/null, a..escape, a loop or a dangling link is reported and never read, and links never enter the execution snapshot. A target that matches any secret pattern, whole or in any path segment, is withheld and no path derived from it is shown. A comparison base hashes a link as Git does (mode120000, blob of the target), so--diffsees a retargeted link. A link changed during capture fails asSNAPSHOT_RACE. The special-file walk now descends only into the--pathsscope. The troubleshooting page, the changelog entry and TODOS.md describe the new behavior; thanks to @nathanshox for the report and first fix (#4540).Why record instead of resolving inside the root
The outside PR (#4540) resolved each link with
realpathandstatand admitted it when the result stayed inside the repository. That is safe only if the resolution itself is: it follows every hop on the live filesystem, can touch an automounter or FUSE target while deciding, and leaves a window between the check and any later use. Recording the target string needs no resolution at all, so its safety does not depend on getting containment right, and it loses nothing an audit needs: Git stores a symlink as exactly that string, and a target inside the repository is audited under its own path anyway.Tests
Security notes
No network, secrets, permissions, workflows, install scripts or dependencies change. The link target string is new text in report.json and the report: it passes through
redact()andJSON.stringify, is bounded by the OS path limit, and sits in the same byte-bounded coverage lists as file paths, which can already hold arbitrary names.Agent notes
Blast radius
The change stays inside
/csocapture. It touches the new link branch incapture(), the textsymlinkTransformationwrites, and the scoped special-file walk. The manifest consumers inlib/cso/cli.tsmatch transformations by theirexcluded:prefix and recheck link entries by target bytes, so they need no change (read in review, and the 106 focused tests and CI's free suite at this head pass).Pre-Landing Review
Four review rounds ran on this security-sensitive change (specialists, red team, an in-house adversarial reader and a second-model review on GPT-6.1 Sol). They found three secret-exposure problems in how link targets were printed, each fixed with a regression test: the in-repository path was printed unredacted, a key=value secret after a slash slipped past the redactor, and redacting per path segment hid URL passwords. The final check of the last fix found nothing. Eight lower-severity notes stay open below.
Review notes
Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.
sf-3df546269d55security finding, details recorded privatelysf-fd631400a8d9security finding, details recorded privatelyExploratory QA
A fixture repository with links to
/etc/passwd,README.mdand a synthetic token was audited withgstack-cso start --offlineat each fixed head. Before the first fix one run file held the raw token; at the final head the run exits 0, no run file holds the token, and none holds/etc/passwdcontent. A synthetic postgres URL with a password is withheld at the final head. Smoke only: races, FIFOs and sockets are covered by the tests, not by probes.Eval Results
No prompt-related files changed, so no evals were selected (the selector deferred the three /cso evals to release coverage).
Issues
Refs #4540
TODOS
Documentation
Status: blocked, shipped under a maintainer exception (recorded in the agent notes). The final audit (scope: the diff from 92c6c8a in lib/cso/snapshot.ts, docs/troubleshooting.md, the changelog entry, TODOS.md and the tests) found three sentences that still said every link is listed by its target string. The auditor's own proposed clause was then applied to all three.
Agent notes
Agent notes
Rebuilt on current main from a text-only read of outside PR #4540 by @nathanshox (never checked out or run); the design differs (record, never resolve). Issue GST-3291.
Approvals
Approved: yes (record r-e93670f56da0). The full approval record stays private.
Plan: exempt: bug fix with a failing-first test (R65, --kind fix)
Plan check: exempt bug fix
Documentation exception: accepted by Captain GStack Minder (GSTA-36) 2026-11-20 via Captain reply on GSTA-672: the docs were corrected by the lane to the auditor's own proposed wording after the final audit
REVIEW_LOOP: passes=3 blocking_found=2 deferred=0 noted=8 fixed=4 scope=frozen fix_checks=1 dispatches=12
Gate edits: none detected (6 listed, 4 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Review-loop exception (4b7d57c): Captain GStack Minder (GSTA-36): one exception at 4b7d57c for the pass-2 key=value redaction leak; read-only full review of the final head, no fix round
Review-loop exception: accepted by Captain GStack Minder (GSTA-36) 2026-11-20 via approval a-df2338bea5e0: GStack Minder, 2026-11-20: grant one fix round for p3/outside-voice#1; fail closed, so a target that matches any secret pattern, whole or per segment, is withheld and its resolved path dropped. (fix-check at 5ef2341, 0 findings)
Second-model review: openai/gpt-6.1-sol via a Capy subagent, completed at cd18650 (one blocker, fixed by the granted fix round).