Bind MCP indexing to authorized filesystem identities - #4679
Merged
Conversation
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.
Summary
mainlanguage-detection contracts while routing ambiguous.m/.plprefix reads and project-marker enumeration through the same authorized identity boundary.Root cause
MCP authorized a canonical pathname before traversal, but later filesystem operations and configuration discovery reopened pathnames without binding every read and directory enumeration to the checked filesystem identity and authorization scope.
The latest
mainlanguage detection added early content and project-marker probes for ambiguous extensions; the conflict resolution preserves those probes while ensuring MCP indexing supplies its identity-bound read and enumeration delegates.The Windows test lane also used the production 5-second transaction contention timeout in a non-fair semaphore stress test and a 250 ms isolated-worker startup/callback budget, so hosted-runner scheduling variance could be misclassified as a transaction leak or healthy-hook timeout.
Impact
This prevents symlink, reparse-point, directory, file, and sidecar swaps from redirecting network-triggered MCP indexing outside the approved CWD/client roots or importing configuration cached under a wider scope.
The CI-only timing changes do not alter production defaults. They preserve dedicated timeout coverage while avoiding false failures on loaded Windows runners.
Validation
dotnet format CodeIndex.sln --no-restoredotnet restore CodeIndex.sln --locked-modedotnet build CodeIndex.sln -c Release --no-restore -p:UseSharedCompilation=false— 0 warnings, 0 errorsmain— net8.0: 585/585; net9.0: 585/585mainmerge — net8.0: 598/598; net9.0: 598/598dotnet run --project tools/CodeIndex.Changelog --no-restore -- check— 79 fragments validatedcdidx status --check --json— workspace matches indexorigin/mainconflicts — no blocking/actionable issues foundDocumentation and changelog
README.md,DEVELOPER_GUIDE.md, andTESTING_GUIDE.mdin English and Japanese for Bind MCP indexing authorization to the directory identity used for traversal #4606.TESTING_GUIDE.md.TESTING_GUIDE.mdfor Stabilize Windows CI timing contracts for shared-writer and hook-worker tests #4687.changelog.d/unreleased/4606.security.md; no additional changelog fragment was needed for the test-only Stabilize Windows CI timing contracts for shared-writer and hook-worker tests #4687 stabilization or the merge-only conflict resolution.Follow-up candidates
None.
Fixes #4606
Fixes #4687