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.Rootboundary, 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

