[Bug] Remote-spec UNRESTRICTED default backend passes arbitrary absolute paths through (read_file("/etc/passwd") reaches the host)
Summary
Follow-up from the #3253 review: anchoring the root spellings (/, .) fixed the root-listing escape, but the UNRESTRICTED default backend in RemoteFilesystemSpec still passes any arbitrary absolute path straight through (LocalFilesystem.resolveUnrestricted — if (target.isAbsolute()) return target;), so in the default remote configuration:
read_file("/etc/passwd")/read_file("C:\Users\...\credentials")reaches the host filesystemlist_files("/tmp"),grep_files(pattern, "/home")enumerate arbitrary host directoriesglob_files(path="/")already behaves the same way (per the #3245 evaluation's point 5)
The same threat model as #3253, but for every absolute path rather than the two root spellings. Out of scope for PR #3254 (which the review noted), tracked here separately.
Suggested direction (per the #3253 review)
The remote-spec default backend probably wants SANDBOXED/ROOTED resolution rather than UNRESTRICTED — the same construction the shared-mode branch of #3247 already uses (new LocalFilesystem(workspace, true, 10, null) re-roots absolute paths under the workspace and rejects ..). The open question for maintainers is the default-behavior impact: today remote-mode users can legitimately read host files outside the workspace via absolute paths, so switching the default backend's mode is a breaking change that may deserve an opt-in/opt-out flag (or follow the deprecation path).
Issue Evaluation
Category: bug (security / workspace containment) | Module: agentscope-harness | Status: Confirmed (verified against main @ ed77530a4)
Root cause, per claim
LocalFilesystem.resolveUnrestrictedreturns an absolute path unchanged —if (target.isAbsolute()) { return target; }(agentscope-harness/src/main/java/io/agentscope/harness/agent/filesystem/LocalFilesystem.java:681-687); the mode is selected by the boolean in the constructor (:144-155,:185-199).RemoteFilesystemSpecbuilds its default backend asnew LocalFilesystem(workspace, false, 10, localNamespaceFactory)(.../filesystem/spec/RemoteFilesystemSpec.java:212), andfalsemaps toLocalFsMode.UNRESTRICTED. Confirmed.LocalFilesystemSpecdefaults toLocalFsMode.ROOTED(.../filesystem/spec/LocalFilesystemSpec.java:61), so the escape is specific to the remote spec's default backend, exactly as reported.CompositeFilesystemadds no containment of its own —routeForPath(.../filesystem/CompositeFilesystem.java:108-137) does prefix routing only, andls(:199-218) /grep(:280-320) hand the path to the selected backend. So the containment guarantee is entirely up to the backend's mode.glob_files(path="/")behaves the same way (same resolver). Confirmed.
One correction / scope expansion the report does not cover: this is not read-only. write (CompositeFilesystem.java:230-237) and edit (:240-259) go through the same route-then-resolve chain, so under the default remote backend an agent-supplied absolute path can also write or modify files outside the workspace, not just enumerate them. That raises the severity above "information disclosure" and should be stated in the issue so the fix is not scoped to reads only.
Not covered by the in-flight PRs
- PR #3254 contains only the two root spellings (
/,.) on the composite's listing path — it does not touchresolveUnrestricted, so arbitrary absolute paths still pass through. - PR #3247's shared-mode branch (
new LocalFilesystem(workspace, true, 10, null)) is opt-in; the defaultfalsebranch atRemoteFilesystemSpec.java:212is unchanged. - Test gap confirmed:
RemoteFilesystemSpecTestasserts routing / namespace isolation / "not a sandbox filesystem", but nothing asserts that an absolute path outside the workspace is rejected under the default remote config. The existing path-safety suites (LocalFilesystemModeTest,PathPolicyTest,WorkspaceManagerPathSafetyTest,WorkspaceContextMiddlewarePathBoundsTest) do not cover that configuration either.
Assessment and recommended direction
The report's framing is right that switching the default backend to SANDBOXED/ROOTED is a behaviour change for anyone who currently reads host files by absolute path through a remote-spec agent, so the default flip needs a maintainer call. Two things would make that call cheaper:
- Surface the backend mode explicitly on
RemoteFilesystemSpec(instead of the barefalsepositional arg at:212) so the choice is readable and adefaultvalue can be deprecated separately from the mechanism. - Treat the write path as part of the same defect — a containment fix that only covers reads leaves
write_file/edit_fileas the escape hatch.
No bot PR this tick: the change is a default-behaviour/security-policy decision owned by the harness maintainers, and #3247/#3254 already occupy the adjacent code. Reply /approve (if a specific direction is agreed) or /revise <direction> and a patch will be generated against main.
Automated evaluation by github-manager-bot
Status: 72 h feedback window expired — no automated PR will be generated, the proposal window here is closed
The evaluation above (5785888097, posted 2026-09-22T23:16:10Z) reached its 72-hour feedback limit at 2026-09-25T23:16:10Z. The thread contains no reply at all, let alone a line starting with an approve, revise or reject command, so per our workflow we skip PR generation and no competing PR will be filed from this proposal window. No action is needed from anyone.
The fix path stays community-owned. PR #3254 by aiyili (fix(harness): contain CompositeFilesystem root ls/grep to the backend root, stacked on #3247) is still OPEN and unmerged at head c04290c1b8 (reviewDecision=REVIEW_REQUIRED, last updated 2026-09-24T12:42:58Z), so the change ships through it rather than through a bot-generated duplicate — and filing a second PR into the same seam now would be a collision, not a contribution. Two things have moved since the evaluation was written: PR #3247 was merged on 2026-09-24T10:15:27Z, and per that evaluation it shipped only the opt-in shared-workspace branch, leaving the default backend construction untouched; #3254 still covers only the two root spellings (/, .) on the composite listing path and does not reach the absolute-path resolver. So the scope recorded in the evaluation — arbitrary absolute paths still passing through the default remote backend, on the read and the write/edit side — is not closed by what landed.
Standing this window down is a timing call, not a verdict on the report. The evaluation's conclusion was that the default flip is a behaviour change for anyone currently reading host files by absolute path through a remote-spec agent, which is a security-policy decision owned by the harness maintainers, not something a generated patch can decide. If the maintainers do want a first-party patch, saying so on this issue with a direction (revise with the chosen default, or an explicit go-ahead on the two steps named above: expose the backend mode on RemoteFilesystemSpec instead of the bare positional flag, and treat write/edit as part of the same defect) is enough to get a spec and a PR generated against current main. The window closing only means the bot stops waiting.
Automated by github-manager-bot
Acknowledged — and a status sync from the #3254 author's side, since two of the moving parts you flagged are now updated:
- #3254 has been rebased onto current
main(single commit,b5d4977) now that #3247 merged, so it no longer carries the stacked commits; its diff is exactly the root-spelling containment for the composite listing path. - The absolute-path gap remains open and unowned, as the window-close notes. For the maintainers' convenience, the two steps named in the evaluation — exposing the backend mode on
RemoteFilesystemSpec(instead of the bare positionalvirtualModeboolean) and treating write/edit through the same resolver as part of this defect — are ready to be picked up as a community PR whenever a direction is given here (default flipped vs. opt-in). Until then no competing PR will be filed into this seam from my side either.