Summary
Before version 1.18.1, yt-mcp attachment handling can read files accessible to the server process without restricting paths to an approved directory. A separate project-name path handling issue can write health snapshot JSON files outside the snapshots directory; these risks arise when caller-controlled values reach file operations without adequate path confinement.
Affected context
The issues affect yt-mcp's attachment and project health tools before version 1.18.1:
add_attachmentchecks whether a caller-provided file path exists but does not confine reads to an approved directory before uploading the file to a YouTrack issue.get_project_healthuses a caller-controlled project value in snapshot filenames, which can allow writes outside the intended snapshots directory.
Exploitation depends on the caller's ability to invoke these tools and on the server process's filesystem permissions.
Exploit preconditions
- Attack surface: The yt-mcp tools for adding attachments and retrieving project health.
- Required access: Ability to invoke the relevant tool through an MCP client; the caller must also be able to access the YouTrack issue used for an attachment exfiltration.
- Trigger point: File reading during
add_attachment, or snapshot file creation duringget_project_health. - Why exploitation is possible: Caller-controlled path components are used in filesystem operations without sufficient directory confinement. Read and write scope is bounded by the server process's permissions.
Why this happens
The tools use caller-controlled values to form filesystem paths without reliably ensuring that the resolved paths remain within their intended directories. This is a path traversal weakness mapped to CWE-22, with unrestricted control of file paths also related to CWE-73: External Control of File Name or Path. As a result, file operations may reach locations beyond the intended attachment or snapshot area.
Potential impact
- An attacker could read files available to the server process and disclose their contents through an accessible YouTrack issue.
- Sensitive configuration, credentials, or other local data may be exposed if readable by the process.
- Caller-controlled project values may cause JSON files to be written outside the snapshots directory.
- The consequences of unauthorized writes may extend to other data or services, depending on process permissions and deployment configuration.
General mitigation guidance
Defensive patterns for these file operations include:
- Resolve paths and verify that they remain within a dedicated, approved directory before reading or writing.
- Prefer server-generated filenames or opaque identifiers over caller-controlled path components.
- Validate project identifiers against a strict allowlist or schema before using them in filenames.
- Keep attachment and snapshot storage separate from sensitive files, and minimize the server process's filesystem permissions.
- Treat MCP arguments as untrusted, including values influenced by prompts or external content, and require authorization checks appropriate to each operation.
How teams detect issues like this
- Use static analysis to identify caller-controlled values flowing into file reads, writes, and path-joining operations.
- Review code for existence-only checks, missing canonical-path containment checks, and user-controlled filename components.
- Apply policy checks that require filesystem operations to use approved storage roots and validated identifiers.
- Monitor for unexpected reads or writes outside designated data directories and review attachment uploads for unusual sources.
- Automated code review tools can help flag path traversal and file-path control patterns.

