Replies: 4 comments
|
I've implemented the three-tier socket API authorization fix for this issue. The implementation:
All changes are in src/api/peer_identity.rs (new), src/api/mod.rs, and src/api/server.rs. Code compiles and formatting passes. I'm the user mentioned — @texasich. Could I get a to open the PR? |
|
i converted this to a discussion beause it's not a bug per se, but i agree that it would be better to improve it. though i need to triage this for now |
|
I have been using a tiny Python proxy for a few days now that just allows Here is the script for inspiration. If you happen to use NixOS the commit also has the config that I am using to run the proxy as a SystemD socket activated user service to make it all work seamlessly. |
|
Noted this issue also connecting to agents in containers and had idea to add a simple opt-in password authentication to JSON-RPC messages. LLM PoC prompt (deepseek-v4-pro / OpenCode):
Result: jasalt@d8122b2
When server is started with the flag it responds to unsafe calls without authentication with: |
Uh oh!
There was an error while loading. Please reload this page.
Is this a reproducible bug?
Current behavior
Any process with access to
herdr.sockgets full RPC access to all API methods. Sandboxed processes need to access the socket just to report agent status via the hook, and this enables a sandbox escape: a sandboxed process (e.g. Claude Code under nono) can spawn unsandboxed processes or inject commands into unsandboxed panes.Expected behavior
Scope API methods by caller identity using
LOCAL_PEERPID(macOS) orSO_PEERCRED(Linux):ping,pane.get,pane.list,pane.read,pane.report_agent,pane.report_agent_session,pane.report_metadata,agent.list,agent.get,workspace.list,workspace.get,events.subscribe,events.waitpane.send_text,pane.send_keys,pane.run,pane.split,pane.closeagent.start,workspace.create,workspace.close,server.stopReproduction
From inside any sandbox that has access to
herdr.sock(I use nono for sandboxing):Both succeed. The spawned process and injected commands run outside the sandbox with full user privileges.
Impact
Agents do not appear in the agent status area, making use of herdr pointless.
The herdr integration hook (installed by
herdr integration install claude) only needspane.report_agent_sessionandpane.report_agent. But granting socket access to a sandboxed agent also exposes destructive methods. This makes it unsafe to grantherdr.sockaccess from any security sandbox.Environment
allow_filegrant onherdr.sockAll reactions