Repository navigation
fix(vfs): hide host filesystem paths in errors (OPE-75) - #205
Merged
Merged
Conversation
Strip OS PathError and LinkError metadata at disk-backed VFS boundaries while retaining their underlying causes. Cover HTTP shell disclosure, filesystem failures, and the synthetic config view. Amp-Thread-ID: https://ampcode.com/threads/T-6a9961a2-0b4b-49b6-b900-130e433631b6 Co-authored-by: Amp <amp@ampcode.com>
There was a problem hiding this comment.
🟢 Approval recommended
The focused changes preserve filesystem error causes, include regression coverage, and have no identified blocking issues.
No open issues 🎉
What changed in this PR
Prevents disk-backed VFS and live-config errors from exposing host filesystem paths through shell and HTTP responses.
Changes:
- Strip OS path metadata while preserving underlying error causes.
- Add filesystem, HTTP shell, and config-view regression coverage.
| File | Description |
|---|---|
| pkg/openlore/vfs.go | Sanitize errors at disk-backed VFS boundaries. |
| pkg/openlore/mcp_http_api_test.go | Check HTTP errors hide host paths and retain virtual paths. |
| pkg/openlore/dirfs_write_test.go | Cover path sanitization and error causes across filesystem failures. |
| pkg/openlore/delegated_identity_test.go | Verify config-view errors hide backing-file paths. |
| pkg/openlore/config_fs.go | Sanitize live-config filesystem errors. |
Review effort: Balanced
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.
Issue
Fixes OPE-75.
Diagnosis
The disk-backed VFS returned OS PathError and LinkError values containing absolute host paths. Shell commands formatted those errors verbatim, so a request such as
cat /does/not/existdisclosed the server's document root through both stderr and the HTTP API's merged output.Fix
Verification
nix develop --command go test -race ./...— passed across all packages.nix develop --command go vet ./...— passed.nix develop --command go build ./...— passed.git diff --check— clean.Work thread
https://ampcode.com/threads/T-6a9961a2-0b4b-49b6-b900-130e433631b6
Opened by the daily Linear bug resolver. Left unmerged for review.