fix: harden vault tools against encoding errors and path traversal#57
Merged
mlorentedev merged 1 commit intomasterfrom Mar 13, 2026
Merged
fix: harden vault tools against encoding errors and path traversal#57mlorentedev merged 1 commit intomasterfrom
mlorentedev merged 1 commit intomasterfrom
Conversation
- Catch UnicodeDecodeError alongside OSError in 5 read_text calls (vault_query, vault_write append, vault_patch, delegate_task, _write_lesson) so non-UTF-8 files return an error instead of crashing the server - Reject glob patterns containing '..' in vault_list and validate rglob results against vault boundary to prevent path traversal - Wrap iterdir/rglob in OSError handlers in list_projects_text, vault_list, and health_report_text so permission errors on individual directories are skipped gracefully - Add tests for all three fix categories
mlorentedev
added a commit
that referenced
this pull request
Mar 13, 2026
🤖 I have created a release *beep* *boop* --- ## [1.11.3](v1.11.2...v1.11.3) (2026-03-13) ### Bug Fixes * harden vault tools against encoding errors and path traversal ([#57](#57)) ([edcd3c0](edcd3c0)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
UnicodeDecodeErrorin 5read_text()calls across vault_query, vault_write (append), vault_patch, delegate_task, and _write_lesson — non-UTF-8 files now return a clean error instead of crashing the server..in vault_list and validate rglob results against vault boundary to prevent path traversaliterdir()/rglob()inOSErrorhandlers inlist_projects_text,vault_list, andhealth_report_textso permission errors on individual directories are skipped gracefullyTest plan
TestUnicodeDecodeErrors— 3 tests: vault_query, vault_patch, vault_write with non-UTF-8 filestest_glob_pattern_rejects_dotdot— validates..rejectiontest_glob_pattern_valid— confirms valid patterns still work