What happened
Two related defects in the nanobot AI agent framework, fixed in v0.4.1. CVE-2026-121864 (CVSS 8.5): when sandboxed exec is enabled, the shell executable used to run commands can be chosen by the caller and is launched before the sandbox is applied — an attacker who induces the agent to create an executable in the workspace and select it as the shell runs it outside the sandbox with the nanobot process's privileges. CVE-2026-121865 (CVSS 7.6): the WebSocket gateway lets a client with a valid token select an existing directory outside the operator-configured workspace as the root of a new conversation, so the agent reads and exposes files readable by the nanobot service account (CWE-22).
Why it matters
Both are agent-execution-sandbox weaknesses in an AI agent framework. The sandbox-escape gives code execution outside the container as the host service user; the workspace escape lets an agent read host files outside its designated directory. Together they let a prompt-injected or malicious client turn agent tool access into broader host compromise.
Attack vector
Caller selects an arbitrary executable as the shell before the sandbox is applied (121864); or a client selects a directory outside the configured workspace as conversation root (121865) so the agent reads/exposes service-readable host files
Affected systems
HKUDS nanobot < 0.4.1 (sandboxed exec; WebSocket gateway)
Mitigation
Upgrade to nanobot v0.4.1+; restrict who can interact with the agent and keep the service account least-privileged