Refuse project skill installs into the filesystem root - #176
Merged
Conversation
🦋 Changeset detectedLatest commit: a464292 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
jamie-at-bunny
marked this pull request as ready for review
August 20, 2026 17:57
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Merged
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.
Follow-up to #174. Project skill installs already refuse the home directory, since per-user config dirs like
~/.claudewould read as project markers there. The filesystem root is the same class of mistake and was still allowed, sobunny skills installrun from/would write/AGENTS.mdand/.agents/skills/bunny-cli/on any writable root.What changed
assertNotHomebecomesassertProjectDir, covering both non-project locations behind one guard.isFilesystemRoothelper: resolves the path first, then tests whether it is its own parent, so a symlinked path cannot dodge the check. Uses the existingdirnameimport rather than pulling inparse.install.tsdocstring,AGENTS.md, and a changeset.Why this was not caught before
The audit that surfaced it ran on macOS, where
/is read-only, so the install failed withEROFSrather than succeeding. On Linux as root it would have landed. The damage was cosmetic, not destructive: no recursive delete is involved and nothing outside the two fixed path suffixes is ever touched.Reviewer notes
readdirSync(cwd)being empty; the new root test asserts the message only, because/is not ours to inspect.AGENTS.mdfrom an earlier version can still be cleaned up, matching the home-directory behaviour established in Skills install scope #174.Checks
bun test: 907 pass, 1 skip, 0 failbun run lint: clean