fix(mcp): enforce repo scope for gate prediction - #717
Conversation
|
Note Gittensory Gate skippedPR closed before full evaluation. No late first comment was created.
💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers. |
|
gittensory · advisory review Reviewed 2 changed file(s) — two independent AI reviewers. Suggested action: ✅ Safe to merge — both reviewers found no blocking issues. Reviewer A · Suggestions
Worth double-checking
Reviewer B · No blocking issues spotted. |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | 9a8af6b | Commit Preview URL Branch Preview URL |
Jun 14 2026, 02:16 PM |
Motivation
gittensory_predict_gateMCP tool enforced contributor self-scope but omitted per-repository authorization, allowing a session to read cached repo-scoped metadata and infer private signals for repos it should not access.Description
await this.requireRepoAccess(repoFullName)in thepredictGatehandler before loading any repo-scoped cached data.requireContributorAccess(input.login)so contributor and repo scopes remain independent.is repo-scoped: a session cannot predict against an inaccessible repototest/unit/mcp-predict-gate.test.tsthat asserts a session-scoped user receives a forbidden error when probing a private repo.src/mcp/server.tsandtest/unit/mcp-predict-gate.test.ts.Testing
CI=1 NO_COLOR=1 npm test -- --run test/unit/mcp-predict-gate.test.ts --reporter=verboseand all tests in that suite passed (3/3).npm run typecheck(TypeScripttsc --noEmit) and it completed successfully.git diff --checkwhich returned cleanly.Codex Task