Process Auditing
Analyze process creation logs for unexpected subprocesses spawned by the agent-zero process, specifically shell interpreters (sh, bash, cmd.exe, powershell).
Agent Zero 0.9.8 contains a critical remote command execution (RCE) vulnerability in its External MCP Servers configuration feature. By providing a crafted JSON configuration, an unauthenticated attacker can execute arbitrary commands on the underlying host with the privileges of the Agent Zero process. This vulnerability is highly critical due to its direct impact on host integrity and potential for lateral movement within a compromised environment.
The vulnerability resides in the application’s handling of External MCP Server configurations. It accepts a JSON payload where a user can specify the command and arguments for an stdio based MCP server. The application then passes these inputs directly into StdioServerParameters without sanitization or an allowlist, leading to direct subprocess execution of user-supplied commands.
When investigating this vulnerability, focus on the following artifacts:
Process Auditing
Analyze process creation logs for unexpected subprocesses spawned by the agent-zero process, specifically shell interpreters (sh, bash, cmd.exe, powershell).
Configuration Analysis
Review the stored configuration files of Agent Zero for suspicious or unauthorized External MCP Server definitions.
To detect potential exploitation attempts, implement the following monitoring:
title: Potential Command Injection via Agent Zero MCP Configurationstatus: experimentaldescription: Detects suspicious subprocess execution initiated by the Agent Zero application due to insecure MCP configuration.logsource: category: process_creationdetection: selection: ParentImage|endswith: '/agent-zero' Image|endswith: - '/sh' - '/bash' - '/cmd.exe' - '/powershell.exe' condition: selectionUpdate Agent Zero to the latest version immediately. If an update is not immediately available, restrict the ability to configure External MCP Servers to trusted users and validate all input configurations against a strict allowlist.