Files
hermes-agent/tests
Adolanium b9d9aeeb58 fix(dashboard): confine fs preview and git diff reads to the managed root
The managed-files API (#57505) confines locked-dashboard reads through
_resolve_managed_path, but the file-preview and git-review routes resolve
through unconfined _fs_path / _git_path. On a locked deployment those
routes still returned auth.json / .env / mcp-tokens and any path outside
the managed root (including via git diff --no-index on an absolute file
argument).

Apply the same locked-root and sensitive-path checks to:
- /api/fs/list, /api/fs/read-text, /api/fs/read-data-url
- /api/git/review/diff and /api/git/file-diff (resolved file target)
- /api/git/review/commit-context (caller-supplied repo cwd; this route
  returns git diff --cached / git diff HEAD with no per-file arg, so the
  cwd itself is the read target)

Local dashboards with no locked root are unchanged. Regression tests cover
credential and outside-root blocks plus in-root allow paths, including a
locked-mode outside-root case for commit-context.

(cherry picked from commit b6ed59823f22fc537f123407a01915135dd6d5fe)
2026-10-06 11:19:16 -04:00
..
…
…