Repository navigation
fix(home-scope): infrastructure-security and mcp-config read $HOME only when opted in - #422
Merged
Merged
Conversation
…ly when opted in The deny-list section and the MCP config/settings scan read the operator's home unconditionally, so a bare CI runner and a populated laptop scored the same project 65 vs 81. Route both through homeScopeEnabled(), as every other home-reading check already does.
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.
What
infrastructure-securityandmcp-confignow read the operator's$HOMEonly with--include-home-skills. They go throughsrc/lib/home-scope.jslike every other home-reading check (RS-10).~/.claude/settings.jsonandsettings.local.jsondrop out ofsettingsPathsunless home scope is on. Project.claude/settings.jsonis always read.repoMcpPaths(cwd)(the committedbase: 'cwd'configs) instead ofmcpConfigPaths(cwd, homedir).checkClaudeSettingsgetsnullfor home, so homeenableAllProjectMcpServersand home hooks no longer change a project's verdict.Why
The same tree scored 65 with a bare runner HOME and 81 with a populated one. A project score that depends on who ran the scan contradicts the CLI's own promise that "home findings do not affect project scores unless --include-home-skills is set."
Tests
test/infrastructure-security.test.js: identical deny-list findings and score for a bare vs a populated home; opting in reads home; project settings are always read.test/home-scope.test.js: home MCP configs are N/A without the flag; home auto-approve leaves the project findings unchanged; opting in reads home.$HOME, so they now passincludeHomeSkills: true. Their assertions are unchanged.npm test: 2249 passed. The 3 that failed are timing tests (performance×2, the RS-32--quiet10s timeout) at load average 51. Run alone, those two files pass 19/19.npm run verify:docs: OK.npm run test:fixture: 5 passed.Not in this PR
Sandbox-gate detection is still a substring match on the hooks JSON (audit R3). Making it structural, counting it only as a PreToolUse hook command, is a separate unit.