/

CVE-2026-50158

Severity:

HIGH RISK

(7.7)

Unrestricted File Write (CWE-73) in yutu Caption Tool

CVE-2026-50158

Deferred

Vulnerability type

Category:

Unrestricted File Write

CWE:

CWE-73

Impact:

Arbitrary File Overwrite, Persistent Code Execution, and Denial of Service

Severity:

HIGH RISK

(7.7)

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

yutu's caption-download MCP tool accepts a caller-controlled file path and writes downloaded caption data to that location without applying the YUTU_ROOT confinement boundary. A principal able to invoke the tool may overwrite files writable by the yutu process, potentially causing code execution, configuration tampering, or denial of service.

Affected context

The vulnerability occurs in deployments where the caption-download MCP tool is available and its file parameter reaches the caption download implementation without path confinement. Risk is greater when the MCP server uses authentication-disabled defaults or otherwise permits an untrusted local or remote client to invoke the tool. Successful caption retrieval also depends on usable service credentials and an accessible caption identifier.

Exploit preconditions

  • Attack surface: The caption-download MCP tool exposed by the yutu server
  • Required access: Permission or network reachability sufficient to invoke the tool; authentication may not be required when the server uses its default authentication-disabled configuration
  • Required data: Usable service credentials and an accessible caption identifier for retrieving caption bytes
  • Trigger point: The caller-controlled file parameter is passed to os.Create() during caption download
  • Why exploitation is possible: The requested path is not confined to the YUTU_ROOT-backed pkg.Root boundary, allowing writes to other locations writable by the yutu process

Why this happens

The underlying bug is external control of a file name or path without enforcing a trusted directory boundary. The caption-download flow treats caller-supplied path data as an acceptable destination and uses os.Create(), which can create or truncate the selected file. This maps to CWE-73: External Control of File Name or Path, because untrusted input determines a filesystem target outside the application's intended confinement area.

Potential impact

  • An attacker may overwrite application files or configuration
  • An attacker could modify shell startup files or other persistence-related files
  • The yutu service may suffer denial of service through destructive file truncation
  • Downloaded content could be used to cause persistent code execution when a writable target is later interpreted or executed
  • Logs or data files could be corrupted, replaced, or poisoned

General mitigation guidance

Mitigation generally focuses on ensuring that caller-controlled paths cannot escape an explicitly trusted storage boundary.

Common defensive patterns include:

  • Resolve and validate destination paths against a fixed, canonical application directory
  • Use the YUTU_ROOT-backed confinement abstraction consistently for caption output
  • Prefer server-selected file names or opaque identifiers over arbitrary caller-supplied paths
  • Reject absolute paths, traversal components, links, and other filesystem escape conditions
  • Apply strict allowlists for permitted output locations and file types
  • Run the yutu process with a dedicated least-privilege account and minimal filesystem write permissions
  • Require authentication and authorization for MCP tool invocation, using secure defaults
  • Separate downloaded content from executable, configuration, startup, and log directories

How teams detect issues like this

Detection can combine source analysis, runtime monitoring, and policy enforcement.

Useful approaches include:

  • Static analysis rules identifying filesystem APIs that receive values derived from MCP parameters or HTTP requests
  • Code review checks for os.Create(), file-open, rename, or write operations that do not pass through a confinement or canonicalization layer
  • Tests that supply absolute paths, traversal sequences, symbolic-link targets, and paths outside the intended root
  • Runtime file-integrity monitoring for unexpected changes to application, configuration, startup, and log files
  • MCP gateway policies that restrict caption-download invocation to authenticated principals and approved destinations
  • Automated security review tools that trace external input into filesystem sinks

Sources

SourceLink
github.comgithub.com/eat-pray-ai/yutu/commit/87026c4eee1ed28775383807087343a750707bf3
github.comgithub.com/eat-pray-ai/yutu/releases/tag/v0.10.9
github.comgithub.com/eat-pray-ai/yutu/security/advisories/GHSA-2c7f-fxww-6w6c

Frequently asked

questions

It can be exploitable through a network-accessible MCP or HTTP interface when an attacker can invoke caption-download. Exposure depends on server binding, authentication, authorization, and other deployment controls.

The caller must be able to invoke the tool, provide or influence the destination path, and obtain caption data using usable service credentials and an accessible caption identifier. The selected target must also be writable by the yutu process.

Route all output through a trusted, canonicalized storage abstraction that enforces the YUTU_ROOT boundary, while replacing arbitrary caller-selected paths with server-controlled destinations.

Enforce authentication and authorization by default, apply least-privilege filesystem permissions, validate paths at security boundaries, and test every externally influenced filesystem operation for escape and overwrite behavior.

Find out what's already
exploitable in your codebase.