Skip to content

test(server): harden MCP tool injection integration coverage - #178

Closed
tonythethompson wants to merge 1 commit into
MCP_hardenfrom
cursor/mcp-tool-injection-test-5193
Closed

tonythethompson wants to merge 1 commit into
MCP_hardenfrom
cursor/mcp-tool-injection-test-5193

Conversation

@tonythethompson

@tonythethompson tonythethompson commented Aug 8, 2026 •

Copy link
Copy Markdown
Owner

Summary

The MCP tool command-injection integration case only asserted 200 ≤ status < 600, which does not prove non-execution.

Changes

  • Record mocked child_process execFile / spawn args in setup.integration.ts.
  • Strengthen the injection test to:
    • show the unsafe name (and its sanitized form) is not allowlisted
    • expect 400 + Unknown toolName
    • assert no new child_process launches for that request
    • assert launch args never embed the unsafe payload / shell metacharacters

Request setup (toolName: "pass_catalog; rm -rf /") is unchanged.

Validation

pnpm vitest run --config vitest.integration.config.ts src/server/__tests__/routes.integration.test.ts
# 63 passed
Open in Web Open in Cursor 

Review in cubic

Assert allowlist rejection of shell-metacharacter tool names, log mocked
child_process launches, and require no exec/spawn for the unsafe payload
instead of a broad HTTP status range.

Co-authored-by: Anthony Thompson <github@trackdub.com>
@vercel

vercel Bot commented Aug 8, 2026

Copy link
Copy Markdown

Deployment failed for project olive-studio with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/trackdub?upgradeToPro=build-rate-limit

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@tonythethompson, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 54 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 76420fcd-d5c0-4a77-a37f-2660b1ba30a3

📥 Commits

Reviewing files that changed from the base of the PR and between 0b32080 and 22d50c9.

📒 Files selected for processing (2)
  • src/server/__tests__/routes.integration.test.ts
  • src/server/__tests__/setup.integration.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@tonythethompson

Copy link
Copy Markdown
Owner Author

Superseded by #184 (single squash onto MCP_harden / #171).

@tonythethompson
tonythethompson deleted the cursor/mcp-tool-injection-test-5193 branch August 9, 2026 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants