What happened
The tool did an existence check and a plain open() with no confinement before uploading bytes to a remote issue. The fix makes file_path secure-by-default (disabled unless allowlisted, with symlink-aware realpath+commonpath confinement and a read cap), and also confines the snapshot filename in monitoring.py to a strict character set to prevent path traversal in get_project_health.
Why it matters
This is the classic MCP prompt-injection lethal trifecta made concrete: read local secrets, then post them to a destination the attacker controls. It shows how a single loosely-confined agent tool can leak host credentials regardless of the model's own behavior.
Attack vector
add_attachment accepts a caller-controlled file_path, checks only that the file exists, reads it without directory confinement and uploads the bytes to a remote YouTrack issue — an arbitrary local file read plus an exfiltration channel in one tool. A compromised MCP client, or an LLM steered by indirect prompt injection, can exfiltrate system files, SSH keys, dotenv/cloud credentials to an issue it can read.
Affected systems
velesnitski/yt-mcp before 1.18.1 (src/yt_mcp/tools/attachments.py)
Mitigation
Upgrade to yt-mcp 1.18.1 or later, which disables file_path mode unless the operator sets YOUTRACK_ATTACHMENT_ROOTS and then re-confinements via realpath/commonpath with a 100 MB read cap; use content/content_base64 mode instead.