/

CVE-2026-51880

Severity:

CRITICAL RISK

(9.8)

Path Traversal (CWE-22) in deeptutor EditFileTool API

CVE-2026-51880

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Unauthorized File Write and Modification

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 path traversal vulnerability in deeptutor's EditFileTool allows a remote caller using the live tutorbot WebSocket interface to write to or edit absolute paths outside the intended bot workspace. The issue becomes critical when the WebSocket interface is reachable by an attacker and the tool accepts attacker-influenced file paths without effective confinement.

A path traversal vulnerability in deeptutor's EditFileTool allows a remote caller using the live tutorbot WebSocket interface to write to or edit absolute paths outside the intended bot workspace. The issue becomes critical when the WebSocket interface is reachable by an attacker and the tool accepts attacker-influenced file paths without effective confinement.

Affected context

The vulnerability occurs in deeptutor 1.4.0 when the live tutorbot WebSocket interface exposes EditFileTool.execute and permits caller-controlled paths. Deployments are at risk when path handling does not enforce a trusted workspace boundary and the service account can modify sensitive files outside that workspace.

The vulnerability occurs in deeptutor 1.4.0 when the live tutorbot WebSocket interface exposes EditFileTool.execute and permits caller-controlled paths. Deployments are at risk when path handling does not enforce a trusted workspace boundary and the service account can modify sensitive files outside that workspace.

Exploit preconditions

  • Attack surface: Live tutorbot WebSocket interface
  • Required access: Ability to connect to the exposed interface and invoke the file-editing tool
  • Trigger point: EditFileTool.execute processing an attacker-influenced path
  • Why exploitation is possible: The tool accepts absolute or traversal-resolving paths without reliably constraining operations to the intended bot workspace
  • Attack surface: Live tutorbot WebSocket interface
  • Required access: Ability to connect to the exposed interface and invoke the file-editing tool
  • Trigger point: EditFileTool.execute processing an attacker-influenced path
  • Why exploitation is possible: The tool accepts absolute or traversal-resolving paths without reliably constraining operations to the intended bot workspace

Why this happens

The underlying bug is insufficient path validation and workspace confinement in a file-writing operation. When user-controlled path values are resolved without canonicalization and strict boundary checks, absolute paths or traversal sequences can escape the intended directory. This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly known as path traversal.

The underlying bug is insufficient path validation and workspace confinement in a file-writing operation. When user-controlled path values are resolved without canonicalization and strict boundary checks, absolute paths or traversal sequences can escape the intended directory. This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly known as path traversal.

Potential impact

  • An attacker may create or modify files outside the bot workspace
  • Sensitive application, configuration, or user data could be overwritten
  • Modified files could alter application behavior or persistence
  • The service account's permissions could enable broader host or container compromise
  • Availability or integrity of connected services could be affected
  • An attacker may create or modify files outside the bot workspace
  • Sensitive application, configuration, or user data could be overwritten
  • Modified files could alter application behavior or persistence
  • The service account's permissions could enable broader host or container compromise
  • Availability or integrity of connected services could be affected

General mitigation guidance

Mitigation generally focuses on enforcing a non-bypassable workspace boundary and reducing the trust placed in tool arguments.

Common defensive patterns include:

  • Resolve candidate paths canonically and verify they remain beneath an approved workspace
  • Reject absolute paths, traversal components, symlink escapes, and ambiguous path encodings
  • Prefer file identifiers or workspace-relative paths over arbitrary filesystem paths
  • Apply allowlists for editable files and permitted operations
  • Run the tutorbot with a dedicated low-privilege service account
  • Restrict WebSocket exposure through authentication, authorization, network policy, and rate controls
  • Use read-only mounts or isolated writable directories where file editing is not required

Mitigation generally focuses on enforcing a non-bypassable workspace boundary and reducing the trust placed in tool arguments.

Common defensive patterns include:

  • Resolve candidate paths canonically and verify they remain beneath an approved workspace
  • Reject absolute paths, traversal components, symlink escapes, and ambiguous path encodings
  • Prefer file identifiers or workspace-relative paths over arbitrary filesystem paths
  • Apply allowlists for editable files and permitted operations
  • Run the tutorbot with a dedicated low-privilege service account
  • Restrict WebSocket exposure through authentication, authorization, network policy, and rate controls
  • Use read-only mounts or isolated writable directories where file editing is not required

How teams detect issues like this

Organizations can look for path traversal risks through:

  • Static analysis rules identifying filesystem operations that consume WebSocket, RPC, or other user-controlled input
  • Code review checks for canonicalization followed by explicit workspace-boundary validation
  • Tests covering absolute paths, traversal sequences, symlink resolution, alternate encodings, and race conditions
  • Runtime monitoring for file writes outside approved directories
  • Policy enforcement that limits tool permissions and blocks unauthorized filesystem targets
  • Automated security review tools that flag untrusted path construction and unconstrained file APIs

Organizations can look for path traversal risks through:

  • Static analysis rules identifying filesystem operations that consume WebSocket, RPC, or other user-controlled input
  • Code review checks for canonicalization followed by explicit workspace-boundary validation
  • Tests covering absolute paths, traversal sequences, symlink resolution, alternate encodings, and race conditions
  • Runtime monitoring for file writes outside approved directories
  • Policy enforcement that limits tool permissions and blocks unauthorized filesystem targets
  • Automated security review tools that flag untrusted path construction and unconstrained file APIs

Sources

SourceLink
gist.github.comgist.github.com/Ro1ME/b5ea6ac856a593e1d20042eb72c00fae
github.comgithub.com/HKUDS/DeepTutor/issues/517

Frequently asked

questions

Yes, the described attack surface is the live tutorbot WebSocket interface. Exploitation depends on that interface being reachable and permitting the attacker to invoke the affected tool.

The attacker generally needs the ability to establish an accepted WebSocket session and submit a request that reaches EditFileTool.execute. Authentication and authorization controls may limit this access.

Treat tool-supplied paths as untrusted, allow only approved workspace-relative targets, canonicalize them, and enforce a strict directory boundary before any file operation.

Combine centralized path-validation utilities with least-privilege execution, restricted tool capabilities, authenticated interfaces, security-focused tests, and monitoring for writes outside approved locations.

Yes, the described attack surface is the live tutorbot WebSocket interface. Exploitation depends on that interface being reachable and permitting the attacker to invoke the affected tool.

The attacker generally needs the ability to establish an accepted WebSocket session and submit a request that reaches EditFileTool.execute. Authentication and authorization controls may limit this access.

Treat tool-supplied paths as untrusted, allow only approved workspace-relative targets, canonicalize them, and enforce a strict directory boundary before any file operation.

Combine centralized path-validation utilities with least-privilege execution, restricted tool capabilities, authenticated interfaces, security-focused tests, and monitoring for writes outside approved locations.

Find out what's already
exploitable in your codebase.