Repository navigation
Description
Summary
A non-recursive project skill root that is itself a symlink is scanned wherever it
points. Pointing .claude/skills at a directory outside the workspace makes bb load
every skill under it into the project's skill list. The recursive root shape already
resolves its root against the project boundary before scanning; the flat shape never
does, so the containment rule the code states for project roots is not enforced on the
path most providers actually use.
Versions and environment
- bb
main@8d926c312569b63924825db761e9cc73663bc3bc, run from source viascripts/bb-dev-app current - Also present in the packaged desktop app 0.40.0
- macOS 26.4 (darwin 25.4.0), Node v26.4.0
- Providers:
claude-code(claude 2.1.251),codex(codex-cli 0.150.1),pi(0.84.4)
Steps to reproduce
ROOT=$(mktemp -d)
mkdir -p "$ROOT/outside/leaked" "$ROOT/repo/.claude"
printf -- '---\nname: leaked\ndescription: outside the repo\n---\n' \
> "$ROOT/outside/leaked/SKILL.md"
git -C "$ROOT/repo" init -q .
ln -s "$ROOT/outside" "$ROOT/repo/.claude/skills" # root itself is the link
bb project create --name leak-demo --root "$ROOT/repo" --json
bb project commands <id> --provider claude-code --jsonleaked is listed with "origin": "project".
Did not reproduce with: a root link that stays inside the repository (correct — that
shape is supported and should keep working); a recursive root shape, which already
rejects the same escape (.cursor/skills declared with recursive: true).
Expected vs actual
Expected: (no project skills — the link leaves the repository)
Actual: ['leaked']
Fixture matrix, bb project commands --provider claude-code, project-origin rows only:
main 8d926c3 with boundary check
projC .claude/skills -> outside ['c-outside-root'] (none)
projB .claude/skills -> in-repo ['b-via-root-link'] ['b-via-root-link']
projA real dirs + entry links ['c-real'] ['c-real']
Only the escaping root changes; every other shape is untouched.
Evidence
scanSkillRootFilesreads the root with no boundary test:
bb/apps/host-daemon/src/command-discovery.ts
Lines 250 to 257 in 8d926c3
async function scanSkillRootFiles( root: CommandScanDirectoryRoot, ): Promise<SkillFileMatch[]> { const entries = await readDirEntries(root.rootPath); if (entries === null) { return []; } const rootLinked = await isSymbolicLinkPath(root.rootPath); - The recursive shape does apply the test, against the same
boundaryPath:
bb/apps/host-daemon/src/command-discovery.ts
Lines 323 to 340 in 8d926c3
async function resolveRecursiveRootPath( root: CommandScanDirectoryRoot, ): Promise<string | null> { const resolvedRoot = await fs.realpath(root.rootPath).catch(() => null); if (resolvedRoot === null) { return null; } if (root.origin !== "project" || root.boundaryPath === undefined) { return resolvedRoot; } const resolvedBoundary = await fs .realpath(root.boundaryPath) .catch(() => null); return resolvedBoundary !== null && isPathWithinDirectory(resolvedBoundary, resolvedRoot) ? resolvedRoot : null; } boundaryPathis already populated for every project root, so no contract change is
needed to consult it:
bb/apps/host-daemon/src/command-handlers/list-commands.ts
Lines 173 to 177 in 8d926c3
const { directories, projectRootPath } = await args.workspace.ancestors(); return directories.map((directoryPath) => directoryScanRoot({ boundaryPath: projectRootPath, identity: `${args.relativePath}:${toPosixRelativePath(projectRootPath, directoryPath)}`,
bb/apps/host-daemon/src/command-handlers/list-commands.ts
Lines 210 to 215 in 8d926c3
} roots.push( directoryScanRoot({ boundaryPath: args.workspace.cwd, identity: entry.path, namePrefix: entry.namePrefix, - The stated intent this violates ("a checked-in (
project) plugin must not point bb
outside the repository"):
bb/packages/plugin-sdk/src/vendor-plugin-roots.ts
Lines 17 to 21 in 8d926c3
* Symlinks follow the root's origin. A personal (`user`) plugin commonly * links a skill from elsewhere in the home directory, so its skill * components are followed; a checked-in (`project`) plugin must not point bb * outside the repository, so its links are not. Command components never * follow a link, whatever the origin. - Investigation thread:
thr_fuwi9eq7iz
What you ruled out
- Not Project slash commands are invisible when .claude/commands/*.md are symlinks #2602 — that is the opposite direction (links wrongly skipped, command files,
walkMarkdownTree). This is a link wrongly followed, on the skill root path. - Not the entry-level symlink rule — entry links are separately over-restricted; that is filed as its own report and does not change this behavior either way.
- Not provider-specific: any provider declaring a non-recursive project skill root is affected (
claude-code.claude/skills,codex.codex/skills,pi.pi/skills). - Not a packaging artifact: reproduces from source on
mainand in packaged 0.40.0.
Suggested priority and effort
Medium — a checked-in symlink silently widens what bb loads into a project's skill list
beyond the reviewed repository contents; no data loss, and it requires a committed
symlink. Effort Low: one boundary check on a path where boundaryPath is already
plumbed. Consider the security label.
Checks
- I reproduced this on the latest release or on
main, or I say above that I could not. - I searched open and closed issues for the same problem.
- If an agent wrote this, the body ends with
> AGENT GENERATEDand links the thread or report.
AGENT GENERATED
Activity
bb-slop-cop commentedon Sep 1, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotClassification: Bug · Medium priority · Low effort · labels:
host,security,confirmed-repro.Report: https://get-bb.github.io/reports/issues/2769.html
confirmed-reproNo pull request was safe because the fix changes a project-path security boundary and fails the simple-fix rule.