Skip to content

fix(permission): deny dot-dot walk-out from directory grants - #1200

Merged
TheGreatAxios merged 2 commits into
mainfrom
cl-8989-grant-traversal
Sep 29, 2026
Merged

TheGreatAxios merged 2 commits into
mainfrom
cl-8989-grant-traversal

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • A Directory Always grant (<dir>/*) covers only paths lexically contained in that directory: the matcher normalizes the subject (POSIX, no filesystem access) and requires a strict anchor/ prefix before the glob ever runs
  • The same containment gate applies on the package-evaluation path, which otherwise lets .. walk out through *
  • Directory scope minting normalizes the directory through the same shared helper, so a stored grant never carries a collapsible segment
  • Warden review required before merge: this change hardens a security-sensitive grant bypass and must not merge without it

Verification

  • bun test src/permission passes: 598 pass, 0 fail
  • bun run typecheck passes and bun run build passes
  • bun run test shows 8595 pass with 1 pre-existing failure in scripts/check-dead-exports.test.ts (missing ts-prune binary; fails identically on clean main)
  • bun run lint passes; bun run check:dead-exports fails identically on clean main for the same missing-binary reason

Fixes CL-8989

@linear-code

linear-code Bot commented Sep 28, 2026

Copy link
Copy Markdown

CL-8989

@TheGreatAxios
TheGreatAxios merged commit 2138c6f into main Sep 29, 2026
13 checks passed
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