Back to skill

Security audit

Qbittorrent Api

Security checks for vulnerabilities and agentic risk

Overview

This qBittorrent helper is mostly a legitimate API reference, but it includes unsafe credential handling and high-impact deletion examples that need review before installation.

Install only if you are comfortable reviewing and changing the examples first. Do not source project .env files; provide qBittorrent credentials through a safer secret mechanism, use HTTPS or localhost-only access, replace weak defaults, use a private temporary cookie jar, and require explicit confirmation before delete, deleteFiles=true, shutdown, plugin install/uninstall, or bulk/all actions.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:27
Finding

Arbitrary Command Execution Through Executable .env Loading

Content
View full analysis
/dev/null || true COOKIE_FILE="/tmp/qb_cookies.txt" ``` ### Technical Analysis The documented workflow loads `.env` with the shell built-in `source`. A sourced file is treated as executable shell code rather than as an inert collection of configuration values. Because the skill instructs the agent to check and use a `.env` file from the current project directory, an attacker who controls that project can add arbitrary shell commands to the file. Those commands execute with the same operating-system identity and permissions as the agent or user following the workflow. Redirecting errors to `/dev/null` and appending `|| true` can also obscure indicators that malicious or malformed commands ran. ### Attack Path 1. An attacker supplies or modifies a project containing a `.env` file. 2. The file includes expected qBittorrent variables so that it appears legitimate, followed by arbitrary shell commands. 3. A user asks the agent to perform a qBittorrent API operation. 4. The agent follows the documented authentication workflow and executes `source .env`. 5. The attacker's commands execute with the agent process's permissions before the API operation occurs. ### Impact Assessment Successful exploitation provides arbitrary command execution under the account running the skill. The attacker could read or modify files accessible to that account, steal environment variables and credentials, alter project content, invoke network utilities, or execute additional local payloads. The vulnerability does not independently grant root privileges, but its scope includes everything available to the affected user account. ]]>
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:17
Finding

Weak Hardcoded Administrator Credentials and Plaintext Authentication Transport

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:532
Finding

Predictable Shared Temporary File Used for Authentication Cookies

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
README.md:16
Finding

Installation Instructions Use an Unverified Mutable Repository Source

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (18)

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Content

Scanner excerpt · README.md (reported line 29)May include surrounding context.

将此仓库作为你的 skills 目录的一部分:

bash
# 在 ~/.claude/settings.json 中配置 skills 路径
{
  "skillDirectories": [
    "~/.claude/skills",

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · README.md (reported line 43)May include surrounding context.

在项目根目录创建 .env 文件:

bash
# .env 文件格式
QB_URL="http://192.168.31.88:8080"
QB_USER="admin"
QB_PASS="your_password"

Credential Access

High
Category
Privilege Escalation
Confidence
97% confidence
Finding

The skill explicitly points to .env content containing qBittorrent credentials, which is direct credential access guidance. In an agent environment, encouraging local secret retrieval materially increases the chance of unauthorized secret collection, exposure in outputs, or reuse beyond user intent.

Content

Scanner excerpt · SKILL.md (reported line 16)May include surrounding context.

  1. 询问用户提供
bash
# .env 文件格式
QB_URL="http://192.168.31.88:8080"
QB_USER="admin"
QB_PASS="123123"

Credential Access

High
Category
Privilege Escalation
Confidence
98% confidence
Finding

The command source .env causes the agent/script to ingest local secrets into its execution environment automatically. This is dangerous because it broadens secret access, can import unintended variables, and may lead to credential leakage through downstream commands, logs, or debugging output.

Content

Scanner excerpt · SKILL.md (reported line 29)May include surrounding context.

qBittorrent 使用 cookie-based 认证:

bash
# 配置(从 .env 读取)
source .env 2>/dev/null || true
COOKIE_FILE="/tmp/qb_cookies.txt"

Credential Access

High
Category
Privilege Escalation
Confidence
88% confidence
Finding

At this location the .env-based secret loading is immediately coupled with persistent cookie handling in /tmp, creating a chain from credential ingestion to reusable session material on disk. That combination increases exposure because other local processes or users may be able to access session artifacts if file permissions are not tightly controlled.

Content

Scanner excerpt · SKILL.md (reported line 30)May include surrounding context.

bash
# 配置(从 .env 读取)
source .env 2>/dev/null || true
COOKIE_FILE="/tmp/qb_cookies.txt"

# 登录并保存 cookie

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The entire skill description and usage guidance are written in Chinese, with no indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking context. This can constitute a language/locale policy issue when the skill implicitly enforces one language without opt-in.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The README says users can 'directly describe your needs' to trigger the skill, then provides ordinary natural-language examples like viewing status, pausing downloads, and creating categories. This does not define explicit trigger phrases, constraints, or exclusion conditions, so activation could overlap with normal conversation about torrents or downloads.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill instructs the agent to read credentials from local .env and CLAUDE.md files, expanding its behavior from API usage guidance into local secret discovery. In an agent setting, this creates unnecessary credential access and increases the chance of exposing or misusing sensitive data beyond what the user explicitly supplied in the current interaction.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The markdown includes example qBittorrent credentials and encourages reading/storing them without any secret-handling warning. Even if presented as an example, embedding realistic credentials in skill content promotes unsafe copying, risks accidental disclosure in logs or transcripts, and conditions the agent to treat secrets as ordinary text.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 34)May include surrounding context.

md
COOKIE_FILE="/tmp/qb_cookies.txt"

# 登录并保存 cookie
curl -c "$COOKIE_FILE" -b "$COOKIE_FILE" \
  -H "Referer: $QB_URL" \
  -d "username=$QB_USER&password=$QB_PASS" \
  "$QB_URL/api/v2/auth/login"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill documents destructive operations such as shutdown, deletion of torrents/files, and plugin removal without a broad upfront warning that these actions can affect system state and data. In an agent-execution context, surfacing such commands as routine examples increases the risk of accidental destructive actions, especially when paired with automation.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 302)May include surrounding context.

jq -r '.[].save_path' | sort | uniq -c | sort -rn | head -10

获取默认保存路径

curl -c cookies.txt -b cookies.txt
"$QB_URL/api/v2/app/defaultSavePath"

text

External Transmission

Medium
Category
Data Exfiltration
Confidence
78% confidence
Finding

This example performs a destructive API action that deletes torrents, and nearby guidance normalizes file deletion in some scenarios. In an agent context, providing ready-to-run destructive commands without mandatory confirmation or stronger guardrails raises the risk of accidental or overbroad data loss.

Content

Scanner excerpt · SKILL.md (reported line 401)May include surrounding context.

bash
# 删除种子(保留文件)- 默认行为
curl -c cookies.txt -b cookies.txt \
  -d "hashes=abc123&deleteFiles=false" \
  "$QB_URL/api/v2/torrents/delete"

External Transmission

Medium
Category
Data Exfiltration
Confidence
84% confidence
Finding

The example deletes multiple torrents in one request, which materially increases blast radius if hashes are wrong, stale, or user intent is misunderstood. In an automation skill, batch destructive commands are more dangerous than ordinary API transmission because a single mistake can remove many items at once.

Content

Scanner excerpt · SKILL.md (reported line 411)May include surrounding context.

md
"$QB_URL/api/v2/torrents/delete"

# 删除多个种子(用 | 分隔)
curl -c cookies.txt -b cookies.txt \
  -d "hashes=abc123|def456|ghi789&deleteFiles=false" \
  "$QB_URL/api/v2/torrents/delete"

External Transmission

Medium
Category
Data Exfiltration
Confidence
93% confidence
Finding

The documented hashes=all deletion example enables deletion of all torrents with a single call, creating an extreme availability and potential data-loss risk. In an agent skill, this is especially dangerous because minor prompt misunderstanding, parameter confusion, or unsafe automation could trigger catastrophic bulk deletion.

Content

Scanner excerpt · SKILL.md (reported line 416)May include surrounding context.

"$QB_URL/api/v2/torrents/delete"

删除全部种子

curl -c cookies.txt -b cookies.txt
-d "hashes=all&deleteFiles=false"
"$QB_URL/api/v2/torrents/delete"

text

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 439)May include surrounding context.

bash
# 设置种子下载限速 1 MB/s
curl -c cookies.txt -b cookies.txt \
  -d "hashes=abc123&limit=1048576" \
  "$QB_URL/api/v2/torrents/setDownloadLimit"

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script template contains hardcoded fallback credentials (admin / 123123) despite claiming configuration should come from CLAUDE.md or environment variables. This can cause accidental authentication attempts with insecure defaults, normalize weak secret practices, and potentially expose a live qBittorrent instance if those defaults are actually in use.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The natural-language instructions switch into Chinese for core operating guidance, which effectively forces a language/locale without user opt-in. The policy allows locale constraints only when they are explicitly offered as a choice or clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.