Skip to content

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

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

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

Conversation

@mouse-value-add

Copy link
Copy Markdown
Collaborator

Problem\nThe MCP tool accepted arbitrary filesystem paths and attempted to load them, while already enforced a home/cwd boundary. This mismatch allowed validation reads outside expected trust boundaries.\n\n## Approach\n- Reused existing guard in \n- Added the same boundary check to before \n- Returned a clear refusal message when the path is outside home/cwd\n\n## Verification\n- Ran full test suite:

you-md@0.2.0 test
vitest run

RUN v2.1.9 /Users/mouse/.openclaw/workspace/nightly/you.md

✓ test/core/validator.test.ts (10 tests) 3ms
✓ test/parser/markdown.test.ts (11 tests) 3ms
✓ test/core/discovery.test.ts (13 tests) 6ms
✓ test/cli/wizard.test.ts (12 tests) 3ms
✓ test/cli/skill.test.ts (9 tests) 12ms
✓ test/cli/check.test.ts (4 tests) 8ms
✓ test/parser/loadFromUrl.test.ts (4 tests) 11ms
✓ test/core/parser.test.ts (16 tests) 15ms
✓ test/core/signals.test.ts (22 tests) 9ms
✓ test/parser/frontmatter.test.ts (7 tests) 3ms
✓ test/core/merger.test.ts (4 tests) 7ms
✓ test/parser/yaml.test.ts (12 tests) 11ms
✓ test/core/known-sections.test.ts (4 tests) 3ms
✓ test/cli/templates.test.ts (6 tests) 3ms
✓ test/cli/skill-status.test.ts (1 test) 12ms
✓ test/parser/timeout.test.ts (3 tests) 4ms
✓ test/mcp/server.test.ts (7 tests) 2ms

Test Files 17 passed (17)
Tests 145 passed (145)
Start at 01:58:42
Duration 670ms (transform 292ms, setup 0ms, collect 822ms, tests 113ms, environment 2ms, prepare 837ms)\n- Result: 17 test files passed, 145 tests passed\n\n## Risks\n- Some workflows that validated files outside home/cwd will now be refused\n\n## Rollback plan\n- Revert commit to restore previous 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