/

CVE-2026-123022

Severity:

HIGH RISK

(7.3)

OS Command Injection (CWE-78) in AgentScope MCP API

CVE-2026-123022

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-77, CWE-78

Impact:

Remote Command Execution

Severity:

HIGH RISK

(7.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

AgentScope's MCP Workspace API has a command-injection vulnerability involving the command argument passed to subprocess.Popen in _config.py. If an attacker can influence that argument through a remotely reachable path, they may be able to execute operating-system commands with the permissions of the AgentScope process.

AgentScope's MCP Workspace API has a command-injection vulnerability involving the command argument passed to subprocess.Popen in _config.py. If an attacker can influence that argument through a remotely reachable path, they may be able to execute operating-system commands with the permissions of the AgentScope process.

Affected context

The issue is reported in AgentScope's MCP Workspace API, in the handling of the command argument in src/agentscope/mcp/_config.py. It may put deployments at risk when a remote request can influence the command value passed to subprocess.Popen. The specific access controls and deployment configuration determine whether an unauthenticated party can reach this behavior.

The issue is reported in AgentScope's MCP Workspace API, in the handling of the command argument in src/agentscope/mcp/_config.py. It may put deployments at risk when a remote request can influence the command value passed to subprocess.Popen. The specific access controls and deployment configuration determine whether an unauthenticated party can reach this behavior.

Exploit preconditions

  • Attack surface: A remotely reachable MCP Workspace API path that reaches the affected command-handling function
  • Required access: Ability to submit or influence the command argument; authentication requirements depend on deployment controls
  • Trigger point: The application passes the supplied or derived command to subprocess.Popen
  • Why exploitation is possible: Command input may be interpreted in a way that allows unintended operating-system commands to run
  • Attack surface: A remotely reachable MCP Workspace API path that reaches the affected command-handling function
  • Required access: Ability to submit or influence the command argument; authentication requirements depend on deployment controls
  • Trigger point: The application passes the supplied or derived command to subprocess.Popen
  • Why exploitation is possible: Command input may be interpreted in a way that allows unintended operating-system commands to run

Why this happens

The underlying issue is improper handling of command input at a process-execution boundary. If untrusted data is incorporated into a command without safe argument separation or suitable validation, command syntax may be interpreted rather than treated as data. This is consistent with CWE-78: Improper Neutralization of Special Elements used in an OS Command and the broader CWE-77: Command Injection category.

The underlying issue is improper handling of command input at a process-execution boundary. If untrusted data is incorporated into a command without safe argument separation or suitable validation, command syntax may be interpreted rather than treated as data. This is consistent with CWE-78: Improper Neutralization of Special Elements used in an OS Command and the broader CWE-77: Command Injection category.

Potential impact

  • An attacker could execute commands with the privileges of the AgentScope process.
  • Sensitive data accessible to that process may be exposed or altered.
  • The service could be disrupted, or its files and configuration modified.
  • Further compromise may be possible depending on the process's permissions and the surrounding environment.
  • An attacker could execute commands with the privileges of the AgentScope process.
  • Sensitive data accessible to that process may be exposed or altered.
  • The service could be disrupted, or its files and configuration modified.
  • Further compromise may be possible depending on the process's permissions and the surrounding environment.

General mitigation guidance

Defensive patterns focus on avoiding shell interpretation and limiting the influence of untrusted input.

  • Prefer APIs that invoke a program with a fixed executable and a distinct argument list, without a shell.
  • Map user choices to a narrow set of predefined operations rather than accepting arbitrary command text.
  • Validate inputs against strict, context-specific schemas and reject unexpected values.
  • Run the service with least privilege and restrict its access to files, credentials, and network resources.
  • Apply access controls to remotely reachable API operations and reduce the amount of untrusted input they accept.

Defensive patterns focus on avoiding shell interpretation and limiting the influence of untrusted input.

  • Prefer APIs that invoke a program with a fixed executable and a distinct argument list, without a shell.
  • Map user choices to a narrow set of predefined operations rather than accepting arbitrary command text.
  • Validate inputs against strict, context-specific schemas and reject unexpected values.
  • Run the service with least privilege and restrict its access to files, credentials, and network resources.
  • Apply access controls to remotely reachable API operations and reduce the amount of untrusted input they accept.

How teams detect issues like this

  • Use static analysis to identify process-execution calls that receive request data or other untrusted values.
  • Review code for shell-enabled process launches, command-string construction, and missing validation at process boundaries.
  • Add tests and policy checks that ensure user-controlled values are passed as arguments, not interpreted as command syntax.
  • Monitor process creation by the service for unexpected executables, arguments, or behavior.
  • Include automated code review checks for command-injection patterns in development workflows.
  • Use static analysis to identify process-execution calls that receive request data or other untrusted values.
  • Review code for shell-enabled process launches, command-string construction, and missing validation at process boundaries.
  • Add tests and policy checks that ensure user-controlled values are passed as arguments, not interpreted as command syntax.
  • Monitor process creation by the service for unexpected executables, arguments, or behavior.
  • Include automated code review checks for command-injection patterns in development workflows.

Sources

SourceLink
github.comgithub.com/agentscope-ai/agentscope/
github.comgithub.com/agentscope-ai/agentscope/issues/3312
github.comgithub.com/agentscope-ai/agentscope/pull/3448
github.comgithub.com/ybyu-ieu/agent-security-advisories/blob/main/agentscope/agentscope-mcp-stdio-workspace-unauthenticated-process-execution.md
vuldb.comvuldb.com/cve/CVE-2026-123022
vuldb.comvuldb.com/submit/1033130
vuldb.comvuldb.com/vuln/431395
vuldb.comvuldb.com/vuln/431395/cti

Frequently asked

questions

The report describes a remotely launchable attack. Exposure depends on whether a remote party can reach the affected API behavior and influence the command argument.

The available description does not specify authentication requirements. Those depend on the deployment's API access controls.

Avoid constructing shell-interpreted commands from external input. Use fixed executables with separate arguments and tightly constrain accepted values.

Review process-execution boundaries, validate inputs against allowlists or schemas, enforce least privilege, and use static analysis and tests to flag unsafe command construction.

The report describes a remotely launchable attack. Exposure depends on whether a remote party can reach the affected API behavior and influence the command argument.

The available description does not specify authentication requirements. Those depend on the deployment's API access controls.

Avoid constructing shell-interpreted commands from external input. Use fixed executables with separate arguments and tightly constrain accepted values.

Review process-execution boundaries, validate inputs against allowlists or schemas, enforce least privilege, and use static analysis and tests to flag unsafe command construction.

Find out what's already
exploitable in your codebase.