Skip to content

Reject empty roots in workspace containment prefix check - #512

Merged
TheGreatAxios merged 1 commit into
mainfrom
cl-6700-reject-empty-path-containment-roots
Aug 22, 2026
Merged

Reject empty roots in workspace containment prefix check#512
TheGreatAxios merged 1 commit into
mainfrom
cl-6700-reject-empty-path-containment-roots

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

An empty root in the workspace roots list made root + sep equal sep (e.g. "/" on Unix), so every absolute path started with it and containment became allow-all. inKnownRoots in src/permission/path-restriction.ts now filters empty roots before the prefix compare.

Adds regression tests: a sensitive absolute path resolved against "" roots is denied, and a root of exactly "/" is confirmed not to be the same bug (it does not act as an allow-all prefix).

Fixes CL-6700
https://linear.app/abklabs/issue/CL-6700

An empty root made root+sep equal sep (e.g. "/" on Unix), so every
absolute path matched and containment became allow-all. Filter empty
roots before the compare in inKnownRoots.
@linear-code

linear-code Bot commented Aug 22, 2026

Copy link
Copy Markdown

CL-6700

@TheGreatAxios
TheGreatAxios merged commit 341b3ad into main Aug 22, 2026
2 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