Skip to content

sec: redact absolute file paths from MCP error messages#228

Merged
himerus merged 1 commit intodevfrom
feature/sec-redact-absolute-file-paths-from-mcp
Mar 27, 2026
Merged

sec: redact absolute file paths from MCP error messages#228
himerus merged 1 commit intodevfrom
feature/sec-redact-absolute-file-paths-from-mcp

Conversation

@himerus
Copy link
Copy Markdown
Contributor

@himerus himerus commented Mar 27, 2026

Summary

Prevent Information Disclosure via Error Messages

handleToolError() in packages/core/src/shared/error-handling.ts returns error.message directly to MCP clients. File-not-found errors include full absolute paths (e.g., /Users/jake/project/custom-elements.json), and Zod validation errors include field names and regex patterns. This leaks project structure information to MCP clients.

Implementation

  1. In handleToolError() at packages/core/src/shared/error-handling.ts:
    • For ...

Recovered automatically by Automaker post-agent hook

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 27, 2026

Warning

Rate limit exceeded

@himerus has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 9 minutes and 52 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 9 minutes and 52 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 69da1353-c1ec-4b6e-98c8-cded9f8ed75c

📥 Commits

Reviewing files that changed from the base of the PR and between 74ce5dc and 9365f0f.

📒 Files selected for processing (14)
  • packages/core/src/shared/error-handling.ts
  • packages/core/src/tools/benchmark.ts
  • packages/core/src/tools/bundle.ts
  • packages/core/src/tools/cdn.ts
  • packages/core/src/tools/component.ts
  • packages/core/src/tools/discovery.ts
  • packages/core/src/tools/framework.ts
  • packages/core/src/tools/health.ts
  • packages/core/src/tools/library.ts
  • packages/core/src/tools/safety.ts
  • packages/core/src/tools/scaffold.ts
  • packages/core/src/tools/tokens.ts
  • packages/core/src/tools/typescript.ts
  • tests/tools/error-handling.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/sec-redact-absolute-file-paths-from-mcp

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 and usage tips.

@himerus himerus merged commit b3a085a into dev Mar 27, 2026
4 of 8 checks passed
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.

1 participant