Repository navigation
Description
Operating system
macOS
Orca version
1.4.159
Details
Summary
The managed agent-hook script ships every Claude Code hook event to Orca as a plaintext application/x-www-form-urlencoded POST to http://127.0.0.1:/hook/. The body is the raw hook JSON, percent-encoded — so it carries absolute filesystem paths, ../../../ traversal sequences, full shell commands, and file contents.
Enterprise AV with HTTP request inspection reads those bodies and matches IDS signatures on them. On a managed macOS host, Orca generated 25 "Network Attack Defense has blocked" detections in 8 days (14 × Attack.LocalFileInclusion., 11 × Exploit.CommandInjection.). The same host had zero such detections in the preceding 21 months of AV history.
Because the curl in the hook script ends in || true, each blocked POST is dropped silently and Orca loses that status update — the agent card goes stale with no error surfaced anywhere.
Environment
- Orca 1.4.159 (macOS, arm64)
- macOS 26.5.2
- Agent: Claude Code, hooks installed via Orca Settings
Mechanism
~/.orca/agent-hooks/claude-hook.sh (as installed), lines 2 and 15–25:
payload=$(cat) # raw Claude Code hook JSON, verbatim
...
printf '%s' "$payload" | curl -sS -X POST "http://127.0.0.1:${ORCA_AGENT_HOOK_PORT}/hook/claude" \
--connect-timeout 0.5 --max-time 1.5 \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "X-Orca-Agent-Hook-Token: ${ORCA_AGENT_HOOK_TOKEN}" \
--data-urlencode "paneKey=${ORCA_PANE_KEY}" \
...
--data-urlencode "worktreeId=${ORCA_WORKTREE_ID}" \
--data-urlencode "payload@-" >/dev/null 2>&1 || true
Server side: out/shared/agent-hook-listener.js (HOOK_SOURCE_BY_PATHNAME, ~line 2987) routes /hook/claude, /hook/codex, … Endpoint coordinates come from out/shared/agent-hook-endpoint-file.js → endpoint.env.
Orca installs this for UserPromptSubmit, Stop, SubagentStop, PreTooit fires on essentially every tool call.
Two properties combine to make the bodies look hostile to an IDS:
- --data-urlencode. A tool input like ../../../scripts/hooks/pre-b ..%2F..%2F..%2F... — encoded path traversal, a muchhigher-confidence LFI signature than a raw ../.
- The payload is unfiltered. PreToolUse bodies contain the full toary shell commands. PostToolUse bodies contain tool_response,including file contents. Any of it can be signature-shaped by pure coincidence.
Evidence: confirmed byte-level match
One detection is pinned exactly. Attack.LocalFileInclusion.1 fired at 2026-07-28 15:40:45Z. The session transcript shows the PreToolUse in flight at that second
was a Bash call:
grep -ao "/etc/passwd\|/proc/self\|php://\|file:///[a-zA-Z]\{0,20\}
The hook posted that command string percent-encoded, putting /etc/pand file:/// into one HTTP request body. Four canonical LFI tokens;IDSmatched and blocked the connection.
This also confirms the AV's HTTP inspector reads loopback traffic on the hook port — detections are attributed to source (null) because there is no resolvable
remote peer, and the curl exits within --max-time 1.5 so there is nher.
Other detections trace to ordinary activity — a PostToolUse carryinlong node_modules/... path; a subagent reading a 120-line shellscript with 27 $(...) substitutions (Exploit.CommandInjection.Gen.75). Nothing unusual is required to trigger this.
Impact
- Silent functional loss. || true swallows the blocked POST. Agent status in Orca goes stale with no diagnostic. This is the user-visible bug.
- Fleet-wide AV noise. On managed endpoints these land in the secucked attack attempts from a developer machine — an incident-response burden, and plausibly gets Orca blocklisted by IT.
- Plaintext prompts and file contents over TCP. Loopback-only and posure is limited — but any local process can bind-scan the port,and the content is the full prompt and tool I/O.
Secondary: runtime WebSocket binds to all interfaces unencrypted
Separate from the above, orca-runtime.json advertises:
"transports": [
{ "kind": "unix", "endpoint": ".../o-<pid>-<id>.sock" },
{ "kind": "websocket", "endpoint": "ws://0.0.0.0:6768" }
],
"authToken": "<redacted — 48 hex chars>"
}
lsof confirms TCP *:6768 (LISTEN). This is the mobile-pairing transport (cf. out/cli/specs/serve.js, out/shared/mobile-relay-pairing-fixtures.js), but bound to
all interfaces, unencrypted, carrying the full JSON-RPC surface plule by anything on the LAN, including untrusted networks.Suggestions: bind to the pairing interface only, require explicit opt-in before listening off-loopback, and use wss://.
Suggested fix
Orca already has a local transport that avoids all of this. out/cli/runtime/transport.js (findTransport(metadata, 'unix', 'named-pipe')) connects the CLI to the
app over the unix domain socket. The hook script can do the same:
curl --unix-socket "$ORCA_AGENT_HOOK_SOCKET" -X POST "http://localh
That removes the loopback TCP listener, takes the traffic out of sctirely, and keeps prompts and file contents off a TCP socket. curl--unix-socket is available on macOS system curl and every mainstream Linux distro; Windows can keep the named pipe.
Failing that, two smaller mitigations that would each help:
- Don't silently swallow failures. Distinguish "AV blocked us" from "Orca isn't running" and surface it once, so stale agent status is diagnosable.
- Send JSON, not form-encoding. Content-Type: application/json withe ..%2F encoded-traversal shape that scores highest with LFIsignatures. It doesn't fix the underlying issue — a /etc/passwd token in a command still matches — but it removes the most reliable trigger.
Reproduction
No AV required to observe the mechanism:
- Install agent hooks from Orca Settings for Claude Code.
- Launch an agent in any worktree.
- Capture loopback: sudo tcpdump -i lo0 -A -s0 "tcp port $(grep ORCA_AGENT_HOOK_PORT "$HOME/Library/Application Support/orca/agent-hooks/endpoint.env" | cut -d=
-f2)" - In the agent, run any command containing a path-traversal or sensitive-path literal, e.g. grep -r "/etc/passwd" .
- The PreToolUse POST body shows the command percent-encoded, incl
With IDS + Network Attack Defense active, Attack.LocalFileInclusion.* detection and the POST never arrives.
Activity