Skip to content

fix(frontend): enforce registered agent filesystem roots#162

Open
OnlyTerp wants to merge 1 commit into
sybil-solutions:mainfrom
OnlyTerp:private/harden-agent-fs-root-boundary-wp006
Open

fix(frontend): enforce registered agent filesystem roots#162
OnlyTerp wants to merge 1 commit into
sybil-solutions:mainfrom
OnlyTerp:private/harden-agent-fs-root-boundary-wp006

Conversation

@OnlyTerp

Copy link
Copy Markdown

WP-006 hardening: agent filesystem list/read APIs now operate only inside server-known registered project roots.

Changes:

  • Agent FS list/read resolves the caller-supplied cwd against registered project roots and rejects unregistered roots.
  • Registered roots and requested targets are canonicalized with realpath before containment checks.
  • Traversal attempts and symlink escapes outside the resolved root are rejected.
  • Legitimate reads/lists inside registered projects continue to work.

Verification:

  • npm --prefix frontend run typecheck: passed
  • npm --prefix frontend run lint: passed
  • Focused frontend/API tests: cd frontend && npx tsx --test ../tests/frontend/agent-fs-root-boundary.test.ts: passed

- Agent FS list/read now resolves the caller-supplied cwd against server-known registered project roots.
- Reject cwd values that are not registered project roots.
- Canonicalize registered roots and requested targets with realpath before containment checks.
- Reject traversal and symlink escapes outside the resolved root.
- Legitimate reads/lists inside registered projects continue to work.
@OnlyTerp OnlyTerp requested a review from 0xSero as a code owner June 22, 2026 14:05
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