mirror of
https://github.com/ruvnet/RuVector.git
synced 2026-05-28 01:44:41 +00:00
Add path validation to all MCP tools that accept user-supplied file paths, preventing arbitrary file read/write via directory traversal. Vulnerable functions patched: - tool_backup: db_path and backup_path now validated - tool_create_db: params.path now validated - get_or_open_db: path now validated Implementation: - validate_path() canonicalizes paths and checks they resolve within the configured data_dir (defaults to cwd) - Configurable via mcp.data_dir in config or RUVECTOR_MCP_DATA_DIR env - Rejects absolute paths outside data_dir, ../traversal, and symlink escapes - 8 unit tests covering all POC attack vectors from the report CVSS 3.1: 9.1 (Critical) → Mitigated Closes #207 Co-Authored-By: claude-flow <ruv@ruv.net> |
||
|---|---|---|
| .. | ||
| cli | ||
| mcp | ||
| config.rs | ||
| main.rs | ||
| mcp_server.rs | ||