Back to skill

Security audit

Pt Site

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its private-tracker purpose, but it handles sensitive tracker cookies and passkeys in under-scoped ways and can trigger qBittorrent downloads with limited safeguards.

Review before installing. Only use this with tracker accounts and qBittorrent instances you are comfortable letting an agent access. Treat cookies and passkeys as passwords, require a final confirmation before any download or qBittorrent import, and prefer a private temporary directory plus redacted credential handling.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:43
Finding
Authentication Cookie Exposure Through Command Arguments and Redirects## Vulnerability Details **File Location**: `SKILL.md`, lines 43-44 **Vulnerability Type**: Sensitive credential exposure **Risk Level**: Medium **Vulnerable Code**: ```bash curl -L -o /tmp/torrent.torrent "https://pt.example.com/download.php?id=123" \ -H "Cookie: c_secure_uid=xxx; c_secure_pass=xxx" ``` ### Technical Analysis The documented download command places the private tracker's authentication cookie directly in curl's command-line arguments. Although authenticated access is necessary for the declared private-tracker functionality, exposing the complete cookie in a command argument is not the minimum-risk way to provide that access. Command arguments may be captured by local process inspection, shell history, debugging output, audit systems, or agent and tool execution logs. The cookie may provide access equivalent to the user's authenticated tracker session and could also contain or lead to disclosure of a personal tracker passkey. The command additionally uses `curl -L` while supplying an explicit `Cookie` header. Custom sensitive headers can create credential-forwarding risk during redirects, particularly if a compromised or misconfigured tracker redirects the request to a different origin. The workflow does not validate the redirect destination or require it to remain on the configured HTTPS tracker origin. ### Attack Path 1. The Skill reads an authentication cookie from `~/.clawdbot/credentials/pt-site/sites.json`. 2. The cookie is interpolated into the documented curl command as an explicit command-line argument. 3. A local process observer, command logger, shell-history collector, or agent telemetry system records the command and extracts the cookie. 4. The attacker submits the captured cookie to the private tracker and impersonates the user's authenticated session. 5. Alternatively, a compromised tracker endpoint issues a redirect to an attacker-controlled origin; the use of an explicit sensitive head ...[truncated 722 chars]
Remediation
## Remediation Suggestions - Do not place authentication cookies directly in command-line arguments. - Supply credentials through a permission-restricted cookie file or curl configuration file created in a private temporary directory. - Set file permissions to owner-only access, such as mode `0600`, and securely remove temporary credential material after use. - Avoid logging commands containing cookies, passkeys, or authenticated download URLs. - Disable redirects unless required. If redirects are necessary, validate every destination and require the final URL to use HTTPS and match the configured tracker host. - Reject tracker URLs containing unexpected schemes, user information, ports, or hosts before making authenticated requests. - Redact cookie values and passkeys from error messages, debugging output, and agent telemetry. - Use short-lived or revocable credentials where supported by the tracker.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:43
Finding
Predictable Torrent Path in Shared Temporary Directory## Vulnerability Details **File Location**: `SKILL.md`, lines 43-52 **Vulnerability Type**: Unsafe temporary-file handling **Risk Level**: Medium **Vulnerable Code**: ```bash curl -L -o /tmp/torrent.torrent "https://pt.example.com/download.php?id=123" \ -H "Cookie: c_secure_uid=xxx; c_secure_pass=xxx" ``` ```bash # Add downloaded torrent ./scripts/qbit-api.sh add-file /tmp/torrent.torrent --category "PT" ``` The associated helper also designates the shared temporary directory without creating a private subdirectory: ```bash TORRENT_DIR="/tmp" ``` ### Technical Analysis The documented workflow uses the fixed and predictable path `/tmp/torrent.torrent`. Because `/tmp` is normally shared among local users and processes, an attacker can predict the path and attempt to pre-create it, replace it, or manipulate it between the download and qBittorrent import operations. If the output path is a symbolic link and the runtime permissions allow access to its target, curl may overwrite or truncate another file. Separately, the workflow has a time-of-check/time-of-use window between writing the torrent and passing it to qBittorrent. A local attacker could replace the downloaded file during that interval, causing qBittorrent to consume attacker-selected torrent metadata. `SKILL.md` advises using unique names in `/tmp`, but its executable example does not implement that safeguard. The script's `TORRENT_DIR="/tmp"` declaration likewise does not create or protect a private working directory. ### Attack Path 1. A local attacker observes or predicts that the Skill will use `/tmp/torrent.torrent`. 2. Before the download, the attacker creates that path as a symbolic link to another file writable by the Skill's user, potentially causing curl to truncate or overwrite the target. 3. Alternatively, the attacker waits for curl to finish and replaces `/tmp/torrent.torrent` before the qBittorrent command opens it. 4. The Skill i ...[truncated 950 chars]
Remediation
## Remediation Suggestions - Create a private temporary directory with `mktemp -d` rather than writing directly to a fixed path in `/tmp`. - Set a restrictive `umask`, such as `077`, before creating temporary files. - Store the torrent under a unique generated filename inside the private directory. - Register a shell `trap` to remove the temporary directory on normal exit and on interruption. - Refuse symbolic links and verify that the downloaded object is a regular file owned by the current user. - Keep the file descriptor or otherwise minimize the interval between download validation and qBittorrent import. - Validate that the downloaded file is a plausible BitTorrent metainfo file before importing it. - Enforce a reasonable maximum response size and verify the HTTP status and content type. - Replace `TORRENT_DIR="/tmp"` with a runtime-created, owner-only directory rather than a shared global location.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
There is a material description-behavior mismatch. The declared purpose describes a full PT workflow: searching, downloading torrent files, and adding them to qBittorrent. The actual code chunk only reads site metadata from a local credentials file and builds a search URL for a given site and term, then prints it. Although reading PT site configuration is consistent with the general domain, the implemented behavior is much narrower than the declared functionality. No download logic, HTTP request execution, torrent file handling, or qBittorrent integration appears in this chunk.

Ssd 3

High
Confidence
97% confidence
Finding
The workflow normalizes handling and replaying private-tracker authentication cookies in plain text, which are highly sensitive bearer-style secrets. In an agent environment, this creates a concrete risk of accidental disclosure through prompts, logs, shell history, screenshots, or downstream tool invocations.

Ssd 3

High
Confidence
98% confidence
Finding
Telling the agent it may retrieve a passkey from the user's profile encourages collection and handling of one of the most sensitive private-tracker identifiers. A leaked passkey can permanently associate activity with a user, enable unauthorized downloads, and may be difficult or impossible to rotate on some trackers.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The skill instructs adding torrents to qBittorrent, which can immediately trigger network activity, disk usage, and potentially long-running downloads, but it gives no warning or explicit confirmation requirement before performing that system-impacting action. In an agent context, this increases the risk of unintended downloads or abuse of local resources.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill includes private-tracker authentication cookies directly in examples and instructs their reuse without emphasizing that they are sensitive credentials. Exposure of these cookies can allow account hijacking, unauthorized downloads, tracker ratio damage, or deanonymization on private sites.

Static analysis

No suspicious patterns detected.