Skip to content

fix: nightly hardening - MCP validate path boundary guard - #22

Open
mouse-value-add wants to merge 1 commit into
mainfrom
chore/nightly-hardening-20260523-mcp-validate-path-guard
Open

fix: nightly hardening - MCP validate path boundary guard#22
mouse-value-add wants to merge 1 commit into
mainfrom
chore/nightly-hardening-20260523-mcp-validate-path-guard

Conversation

@mouse-value-add

Copy link
Copy Markdown
Collaborator

Problem

The MCP youmd_validate tool accepted arbitrary file paths. This allowed validation reads outside the intended home/project boundaries, while youmd_init already enforced path safety.

Approach

  • Reused the existing isPathSafe guard in youmd_validate.
  • Added a shared unsafe-path message helper to keep behavior consistent between youmd_init and youmd_validate.

Verification

  • Ran targeted tests: npx vitest run test/mcp/server.test.ts --reporter=dot (7 passed).
  • Confirmed no behavior change for safe paths.

Risks

  • Low risk: only blocks unsafe validate paths that were previously allowed.
  • Users validating files outside home/cwd will now receive a refusal message.

Rollback plan

  • Revert this commit to restore prior youmd_validate behavior.

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