/

CVE-2026-51881

Severity:

CRITICAL RISK

(9.8)

Code Injection (CWE-94) in deeptutor ExecTool Service

CVE-2026-51881

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Remote Code Execution

Severity:

CRITICAL RISK

(9.8)

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

A code injection vulnerability in deeptutor's ExecTool.execute function may allow commands supplied through the live tutorbot WebSocket interface to be executed in the service environment. The issue becomes critical when the WebSocket endpoint is reachable by an untrusted or insufficiently restricted caller and the tool layer processes caller-controlled input as shell logic.

A code injection vulnerability in deeptutor's ExecTool.execute function may allow commands supplied through the live tutorbot WebSocket interface to be executed in the service environment. The issue becomes critical when the WebSocket endpoint is reachable by an untrusted or insufficiently restricted caller and the tool layer processes caller-controlled input as shell logic.

Affected context

The vulnerability occurs in deeptutor deployments that expose the live tutorbot WebSocket interface and permit that interface to invoke ExecTool.execute. Risk depends on network exposure, authentication and authorization controls, and whether the tool is enabled with access to sensitive service resources.

The vulnerability occurs in deeptutor deployments that expose the live tutorbot WebSocket interface and permit that interface to invoke ExecTool.execute. Risk depends on network exposure, authentication and authorization controls, and whether the tool is enabled with access to sensitive service resources.

Exploit preconditions

  • Attack surface: The live tutorbot WebSocket interface
  • Required access: Network reachability and whatever authentication or authorization the deployment requires
  • Trigger point: Processing a WebSocket request that reaches ExecTool.execute
  • Why exploitation is possible: Caller-influenced content is treated as executable shell input rather than constrained data
  • Attack surface: The live tutorbot WebSocket interface
  • Required access: Network reachability and whatever authentication or authorization the deployment requires
  • Trigger point: Processing a WebSocket request that reaches ExecTool.execute
  • Why exploitation is possible: Caller-influenced content is treated as executable shell input rather than constrained data

Why this happens

The underlying bug is a failure to separate untrusted tool-request data from executable command construction. When values supplied through a remote interface can influence shell execution without strict allowlisting, argument separation, and context-aware validation, an attacker may inject additional commands. This behavior maps to CWE-94, Improper Control of Generation of Code, because externally influenced input can alter executable logic.

The underlying bug is a failure to separate untrusted tool-request data from executable command construction. When values supplied through a remote interface can influence shell execution without strict allowlisting, argument separation, and context-aware validation, an attacker may inject additional commands. This behavior maps to CWE-94, Improper Control of Generation of Code, because externally influenced input can alter executable logic.

Potential impact

  • An attacker may execute arbitrary commands within the deeptutor service environment.
  • The attacker could read, alter, or delete data accessible to the service account.
  • Credentials, tokens, or configuration secrets may be exposed.
  • The compromised service could be used for lateral movement or further disruption.
  • Application integrity and hosted tutoring workflows may be affected.
  • An attacker may execute arbitrary commands within the deeptutor service environment.
  • The attacker could read, alter, or delete data accessible to the service account.
  • Credentials, tokens, or configuration secrets may be exposed.
  • The compromised service could be used for lateral movement or further disruption.
  • Application integrity and hosted tutoring workflows may be affected.

General mitigation guidance

Mitigation generally focuses on removing shell interpretation from remotely

influenced tool calls and reducing the trust placed in WebSocket requests.

Common defensive patterns include:

  • Prefer direct library or process APIs with fixed executables and separated arguments instead of shell command construction.
  • Use strict allowlists for permitted tools, operations, and argument formats.
  • Treat WebSocket content as untrusted data and validate it against an explicit schema before dispatch.
  • Require strong authentication, authorization, and narrowly scoped tool permissions.
  • Run the service with a dedicated least-privilege identity and isolate filesystem, network, and secret access.
  • Disable command-execution tools when they are not required and apply resource and execution-time limits.
  • Avoid exposing sensitive environment variables or credentials to the service process.

Mitigation generally focuses on removing shell interpretation from remotely

influenced tool calls and reducing the trust placed in WebSocket requests.

Common defensive patterns include:

  • Prefer direct library or process APIs with fixed executables and separated arguments instead of shell command construction.
  • Use strict allowlists for permitted tools, operations, and argument formats.
  • Treat WebSocket content as untrusted data and validate it against an explicit schema before dispatch.
  • Require strong authentication, authorization, and narrowly scoped tool permissions.
  • Run the service with a dedicated least-privilege identity and isolate filesystem, network, and secret access.
  • Disable command-execution tools when they are not required and apply resource and execution-time limits.
  • Avoid exposing sensitive environment variables or credentials to the service process.

How teams detect issues like this

Detection approaches can include:

  • Static analysis for shell-spawning APIs, command strings assembled from request data, and subprocess calls using shell interpretation.
  • Code review checks for WebSocket handlers that pass unvalidated fields into execution helpers.
  • Tests using metacharacter-like input to verify that values remain data and cannot change command structure.
  • Runtime monitoring for unexpected child processes, command execution, and unusual outbound connections from the service.
  • Policy enforcement that restricts which components may invoke process execution and which network identities may reach the WebSocket endpoint.
  • Automated security review tools may help identify dangerous data flows, but findings should be validated against deployment controls.

Detection approaches can include:

  • Static analysis for shell-spawning APIs, command strings assembled from request data, and subprocess calls using shell interpretation.
  • Code review checks for WebSocket handlers that pass unvalidated fields into execution helpers.
  • Tests using metacharacter-like input to verify that values remain data and cannot change command structure.
  • Runtime monitoring for unexpected child processes, command execution, and unusual outbound connections from the service.
  • Policy enforcement that restricts which components may invoke process execution and which network identities may reach the WebSocket endpoint.
  • Automated security review tools may help identify dangerous data flows, but findings should be validated against deployment controls.

Sources

SourceLink
gist.github.comgist.github.com/Ro1ME/77331f8ae45f617d33f7100c3f48cac5
github.comgithub.com/HKUDS/DeepTutor/issues/518

Frequently asked

questions

It may be remotely exploitable when an attacker can reach the live tutorbot

WebSocket interface and cause a request to invoke the affected tool. Actual

scope depends on deployment exposure and access controls.

The description does not establish a required authentication state. The

effective prerequisite is whatever access is needed to submit a request that

reaches ExecTool.execute; publicly reachable or weakly protected endpoints

present greater risk.

Remove shell interpretation from remote tool execution, use fixed executables

with separated arguments, and enforce strict operation and argument

allowlists before dispatch.

Treat WebSocket messages as untrusted input, apply schema validation and

authorization, minimize tool privileges, isolate execution, and monitor for

unexpected process activity.

It may be remotely exploitable when an attacker can reach the live tutorbot

WebSocket interface and cause a request to invoke the affected tool. Actual

scope depends on deployment exposure and access controls.

The description does not establish a required authentication state. The

effective prerequisite is whatever access is needed to submit a request that

reaches ExecTool.execute; publicly reachable or weakly protected endpoints

present greater risk.

Remove shell interpretation from remote tool execution, use fixed executables

with separated arguments, and enforce strict operation and argument

allowlists before dispatch.

Treat WebSocket messages as untrusted input, apply schema validation and

authorization, minimize tool privileges, isolate execution, and monitor for

unexpected process activity.

Find out what's already
exploitable in your codebase.