Skip to content

Resolve symlinks before the shell secret denylist - #950

Merged
TheGreatAxios merged 2 commits into
mainfrom
cl-7790-shell-tokens-resolved-paths
Sep 12, 2026
Merged

Resolve symlinks before the shell secret denylist#950
TheGreatAxios merged 2 commits into
mainfrom
cl-7790-shell-tokens-resolved-paths

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • Shell secret matching resolves symlinks before the denylist, so a benign-named symlink into a secret file asks exactly like the secret name itself
  • One shared token matcher serves both call sites, with the cheap lexical check first and realpath only for path-like survivors, so the hot auto-allow path stays syscall-free
  • Pure name-listings still list freely: dumping contents asks, listing a name does not
  • Connection-string keys stay out of the env-key scrub classifier; widening that shape check would redact benign connection strings and needs its own measured ticket

Verification

  • bun run lint, bun run typecheck, bun run build pass
  • New regression suite covers the symlinked dump, the direct secret name, unaffected listings, both call sites, and the shared helper
  • Full suite: 7081/7082 pass; the single failure (gaasbot prompt size budget) also fails on origin/main with changes stashed, so it predates this branch

Fixes CL-7790

@linear-code

linear-code Bot commented Sep 12, 2026

Copy link
Copy Markdown

CL-7790

A benign-named symlink into a secret file asks exactly like the secret name itself, while pure name-listings still list freely.
@TheGreatAxios
TheGreatAxios force-pushed the cl-7790-shell-tokens-resolved-paths branch from 73b6050 to 547e851 Compare September 12, 2026 18:09
Bare tokens with no dot or slash skipped the resolve leg, so a link
named notes into .env auto-allowed where notes.txt asked. Bare
non-flag tokens now pay one lstat probe; a hit resolves the target
and a miss stays syscall-free past that probe. Home expansion puts
the secret reason on cat ~/notes instead of the coincidental
outside-workspace ask, and the path-like comment no longer claims
globs cannot reach secrets.
@TheGreatAxios
TheGreatAxios merged commit 1271571 into main Sep 12, 2026
9 checks passed
@TheGreatAxios
TheGreatAxios deleted the cl-7790-shell-tokens-resolved-paths branch September 12, 2026 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant