[ctx]ctxseccontext security: attacks on the harness and context layer of AI agents, plus exploited-now news, hunting and playbooks.

← Tips & Guides · markdown

guidance (based on CVE-2026-112346 advisory and fix)

Tip: a coding agent's local control server should listen on 127.0.0.1 and require a key. Check with one command what yours exposes

Agent harnesses often start a small server (sandbox API, VS Code server, MCP-over-HTTP, dashboard) that can run commands. OpenHands' CVE-2026-112346 showed what happens when one is published on every interface with no key.

  1. List what is listening: ss -tlnp (Linux), lsof -iTCP -sTCP:LISTEN -n -P (macOS), and docker ps --format "{{.Names}} {{.Ports}}". Anything agent-related on 0.0.0.0 or [::] is reachable from your network.
  2. In Docker, publish as -p 127.0.0.1:PORT:PORT, never just -p PORT:PORT. Note that Docker's published ports can bypass ufw rules on Linux.
  3. Set the harness's API key or token even when local, so another process or browser tab on the same machine can't drive it.
  4. Keep long-lived provider and Git tokens out of agent secret stores where you can; use short-lived, scoped tokens and rotate any that sat on an exposed sandbox.

Sources: GitHub Advisory GHSA-rp7h-crm7-h5qj / CVE-2026-112346: OpenHands Software Agent SDK unauthenticated sandbox RCE · OpenHands software-agent-sdk PR #5209