Skip to content

fix(vfs): hide host filesystem paths in errors (OPE-75) - #205

Merged
aakarim merged 1 commit into
mainfrom
fix/ope-75-hide-host-paths
Oct 20, 2026
Merged

aakarim merged 1 commit into
mainfrom
fix/ope-75-hide-host-paths

Conversation

@aakarim

@aakarim aakarim commented Oct 20, 2026

Copy link
Copy Markdown
Owner

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/exist disclosed the server's document root through both stderr and the HTTP API's merged output.

Fix

  • Remove OS path metadata at DirFS read, stat, directory, write, and delete boundaries, including atomic-write and staging errors.
  • Apply the same protection to the synthetic live-config filesystem.
  • Preserve underlying filesystem sentinels and errno values for errors.Is/os.IsNotExist rather than replacing errors with strings. Commands continue to provide the requested virtual path.
  • Extend HTTP shell and config-view regressions, and cover 13 filesystem failure cases including wrapped write failures and rename errors.

Verification

  • Reproduced before the fix: TestMCPHTTPAPI_ShellCommandFailureIsResult failed because the response contained the temporary host directory.
  • After the fix: focused HTTP, filesystem, and config-view regressions pass.
  • nix develop --command go test -race ./... — passed across all packages.
  • nix develop --command go vet ./... — passed.
  • nix develop --command go build ./... — passed.
  • gofmt and 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.

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>
@linear-code

linear-code Bot commented Oct 20, 2026

Copy link
Copy Markdown

OPE-75

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@aakarim
aakarim merged commit d03ecea into main Oct 20, 2026
8 checks passed
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.

2 participants