/cso audits repositories that track symlinks, without following them (#4540) (#4567)

`/cso` no longer stops on a repository that tracks a symlink, such as
gstack's own `connect-chrome` or `CLAUDE.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/passwd` or
out through `..`.

Nothing to do. FIFOs, sockets and devices are still refused, and
`--paths` now limits that check to the audited directories.

Co-authored-by: nathanshox <196341+nathanshox@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p1/specialist-batched#1 reader=security
Review-Finding: p1/red-team#3 reader=red-team
Review-Finding: p2/red-team#1 reader=red-team
Review-Finding: p3/outside-voice#1 reader=outside-voice
This commit is contained in:
authored and GitHub committed 2026-11-20 18:26:22 +00:00
1 parent 6287c75e2c
commit a529769efd
6 files changed
+359 -24

No files matched your search

+8 -2
View File
@@ -1636,7 +1636,12 @@ or too large. Each message names the cap that applied:
- **64 MiB source cap.** The full size of every such file outside dependency
and VCS directories counts, including files over 1 MiB whose contents are
withheld from the audit.
- **Symlinks.** A tracked symlink anywhere in the repository stops the run.
- **Special files.** A nonignored FIFO, socket or device inside the audit
scope (the whole repository, or the `--paths` directories) stops the run.
Symlinks do not: since the first release after v1.102.0.0 (#4540), each
tracked or nonignored symlink is listed in the report with its target string, or notes that the target was withheld when it matches a secret pattern
and is never followed, so a link to `/etc/passwd` or out through `..` is
reported, not read.
**Fix.** No setting raises these caps. For the 64 MiB source cap, rerun with
`--paths` set to the comma-separated repo-relative directories you want audited
@@ -1648,7 +1653,8 @@ With `--diff`, every changed path outside dependency directories must be inside
`--paths`, or the run is refused. Do not audit a hand-trimmed copy: /cso would treat it as the whole
repository and report nothing as skipped. `--paths` does not lower the
manifest cap or the 100,000-entry limit, because every skipped path still has a
manifest entry (about 50,000 files fit). Symlinks must be removed. Add your
manifest entry (about 50,000 files fit). Remove or ignore a FIFO, socket or
device, or narrow `--paths` past it. Add your
file count or size to
[#2993](https://github.com/garrytan/gstack/issues/2993).