Back to skill

Security audit

FeiNiu NAS Download Manager

Security checks for vulnerabilities and agentic risk

Overview

This NAS download skill does what it claims, but its shell script handles remote commands and credentials unsafely enough that users should review it before installing.

Install only if you are comfortable reviewing and fixing the shell script first. Move the qBittorrent password out of the script, avoid admin credentials, quote or redesign the SSH/curl calls so magnet links cannot become shell syntax, use private temporary files with cleanup, and require explicit confirmation before adding downloads or copying torrent files to the NAS.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
nas-download.sh:23
Finding

Remote Shell Command Injection Through Magnet URI Input

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
nas-download.sh:4
Finding

Plaintext qBittorrent Password Storage and Command-Line Exposure

Content
View full analysis
/dev/null && curl -s --unix-socket $QBT_SOCK -b /tmp/qbt_cookie http://localhost/api/v2/torrents/info" ``` ```bash ssh $NAS_HOST "curl -s --unix-socket $QBT_SOCK -X POST http://localhost/api/v2/auth/login -d 'username=admin&password=$QBT_PASSWORD' -c /tmp/qbt_cookie && curl -s --unix-socket $QBT_SOCK -b /tmp/qbt_cookie -X POST http://localhost/api/v2/torrents/add -d 'urls=$2'" ``` ### Technical Analysis The documented configuration procedure instructs users to place the qBittorrent WebUI password directly in the script. A configured copy therefore becomes a plaintext credential container that may be exposed through source access, backups, synchronization, accidental publication, or overly broad filesystem permissions. The password is also expanded into an SSH command string and then passed to curl as command-line data. This can expose it through process inspection, command auditing, diagnostic output, or other command metadata on the involved systems. Because the password is inserted into shell source text, shell-significant characters in the password may also break the intended quoting. If an attacker can influence the configured value, this becomes another potential command-injection path. ### Attack Path 1. A user follows the configuration instructions and replaces `your_password` with a real qBittorrent password. 2. An attacker or lower-privileged local process obtains read access to the script, a backup, process ar ...[truncated 703 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
nas-download.sh:14
Finding

Predictable Shared Temporary Files Expose Session and Torrent Data

Content
View full analysis
/dev/null && curl -s --unix-socket $QBT_SOCK -b /tmp/qbt_cookie http://localhost/api/v2/torrents/info" ``` The torrent upload branch similarly uses a predictable shared filename: ```bash elif [[ -f "$2" ]]; then scp "$2" $NAS_HOST:/tmp/torrent.tmp ssh $NAS_HOST "curl -s --unix-socket $QBT_SOCK -X POST http://localhost/api/v2/auth/login -d 'username=admin&password=$QBT_PASSWORD' -c /tmp/qbt_cookie && curl -s --unix-socket $QBT_SOCK -b /tmp/qbt_cookie -X POST http://localhost/api/v2/torrents/add -F 'torrents=@/tmp/torrent.tmp'" echo "Torrent file added" ``` ### Technical Analysis Both `/tmp/qbt_cookie` and `/tmp/torrent.tmp` are fixed, predictable paths in a shared temporary directory. The script does not: - Create a private temporary directory. - Use `mktemp` for atomic unique names. - Set a restrictive `umask`. - Verify that existing paths are not symbolic links. - Remove the files after use. - Prevent concurrent invocations from overwriting one another. The cookie file contains authenticated qBittorrent session material. Depending on resulting ownership and permissions, another NAS user may be able to inspect or misuse it. The uploaded torrent file can be replaced between `scp` and the subsequent curl request. Concurrent runs can also overwrite the same path, causing one invocation to submit another invocation’s torrent. Pre-existing files or symbolic links may cause unsafe file replacement behavior according to remote SSH and filesystem configuration. ### Attack Path 1. An attacker with local NAS access predicts `/tmp/qbt_cook ...[truncated 1089 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (11)

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · nas-download.sh (reported line 16)May include surrounding context.

sh
case "$1" in
  list)
    if [[ "$2" == "-all" ]]; then
      ssh $NAS_HOST "curl -s --unix-socket $QBT_SOCK -X POST http://localhost/api/v2/auth/login -d 'username=admin&password=$QBT_PASSWORD' -c /tmp/qbt_cookie >/dev/null && curl -s --unix-socket $QBT_SOCK -b /tmp/qbt_cookie http://localhost/api/v2/torrents/info" | python3 -c "import sys,json; data=json.load(sys.stdin); [print(f\"{t['name'][:60]:60} {t['state']:12} {t['progress']*100:5.1f}% {t['dlspeed']/1024/1024:6.1f}MB/s\") for t in data]"
    else
      ssh $NAS_HOST "curl -s --unix-socket $QBT_SOCK -X POST http://localhost/api/v2/auth/login -d 'username=admin&password=$QBT_PASSWORD' -c /tmp/qbt_cookie >/dev/null && curl -s --unix-socket $QBT_SOCK -b /tmp/qbt_cookie http://localhost/api/v2/torrents/info" | python3 -c "import sys,json; data=json.load(sys.stdin); [print(f\"{t['name'][:60]:60} {t['state']:12} {t['progress']*100:5.1f}% {t['dlspeed']/1024/1024:6.1f}MB/s\") for t in data if t['progress'] < 1.0]"
    fi

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · nas-download.sh (reported line 18)May include surrounding context.

sh
case "$1" in
  list)
    if [[ "$2" == "-all" ]]; then
      ssh $NAS_HOST "curl -s --unix-socket $QBT_SOCK -X POST http://localhost/api/v2/auth/login -d 'username=admin&password=$QBT_PASSWORD' -c /tmp/qbt_cookie >/dev/null && curl -s --unix-socket $QBT_SOCK -b /tmp/qbt_cookie http://localhost/api/v2/torrents/info" | python3 -c "import sys,json; data=json.load(sys.stdin); [print(f\"{t['name'][:60]:60} {t['state']:12} {t['progress']*100:5.1f}% {t['dlspeed']/1024/1024:6.1f}MB/s\") for t in data]"
    else
      ssh $NAS_HOST "curl -s --unix-socket $QBT_SOCK -X POST http://localhost/api/v2/auth/login -d 'username=admin&password=$QBT_PASSWORD' -c /tmp/qbt_cookie >/dev/null && curl -s --unix-socket $QBT_SOCK -b /tmp/qbt_cookie http://localhost/api/v2/torrents/info" | python3 -c "import sys,json; data=json.load(sys.stdin); [print(f\"{t['name'][:60]:60} {t['state']:12} {t['progress']*100:5.1f}% {t['dlspeed']/1024/1024:6.1f}MB/s\") for t in data if t['progress'] < 1.0]"
    fi

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill declares shell tool usage but does not constrain tool scope with explicit permissions or allowed-tools metadata. In a skill that can invoke a shell script to manage NAS downloads over SSH, this increases the chance of unintended command execution or broader-than-necessary access if the agent or surrounding platform grants shell capabilities implicitly.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The documentation explains how to add magnet links and torrent files but does not clearly warn that doing so will immediately initiate downloads and change the state of the user's NAS. This can lead to unintended system modification, bandwidth consumption, storage usage, or policy/legal issues if a user invokes the skill without understanding the side effects.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The skill documentation tells users to configure credential-related values, including a qBittorrent password and SSH connection details, without any warning about secure secret storage or handling. This encourages placement of sensitive credentials in script variables or skill files where they may be exposed through logs, backups, permissions misconfiguration, or accidental sharing.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script embeds a qBittorrent administrative password directly in source code and uses it silently during remote operations. Hardcoded credentials are dangerous because they can be disclosed through source distribution, logs, backups, or local inspection, enabling unauthorized access to the NAS downloader service.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% 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 · nas-download.sh (reported line 16)May include surrounding context.

sh
case "$1" in
  list)
    if [[ "$2" == "-all" ]]; then
      ssh $NAS_HOST "curl -s --unix-socket $QBT_SOCK -X POST http://localhost/api/v2/auth/login -d 'username=admin&password=$QBT_PASSWORD' -c /tmp/qbt_cookie >/dev/null && curl -s --unix-socket $QBT_SOCK -b /tmp/qbt_cookie http://localhost/api/v2/torrents/info" | python3 -c "import sys,json; data=json.load(sys.stdin); [print(f\"{t['name'][:60]:60} {t['state']:12} {t['progress']*100:5.1f}% {t['dlspeed']/1024/1024:6.1f}MB/s\") for t in data]"
    else
      ssh $NAS_HOST "curl -s --unix-socket $QBT_SOCK -X POST http://localhost/api/v2/auth/login -d 'username=admin&password=$QBT_PASSWORD' -c /tmp/qbt_cookie >/dev/null && curl -s --unix-socket $QBT_SOCK -b /tmp/qbt_cookie http://localhost/api/v2/torrents/info" | python3 -c "import sys,json; data=json.load(sys.stdin); [print(f\"{t['name'][:60]:60} {t['state']:12} {t['progress']*100:5.1f}% {t['dlspeed']/1024/1024:6.1f}MB/s\") for t in data if t['progress'] < 1.0]"
    fi

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% 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 · nas-download.sh (reported line 18)May include surrounding context.

sh
case "$1" in
  list)
    if [[ "$2" == "-all" ]]; then
      ssh $NAS_HOST "curl -s --unix-socket $QBT_SOCK -X POST http://localhost/api/v2/auth/login -d 'username=admin&password=$QBT_PASSWORD' -c /tmp/qbt_cookie >/dev/null && curl -s --unix-socket $QBT_SOCK -b /tmp/qbt_cookie http://localhost/api/v2/torrents/info" | python3 -c "import sys,json; data=json.load(sys.stdin); [print(f\"{t['name'][:60]:60} {t['state']:12} {t['progress']*100:5.1f}% {t['dlspeed']/1024/1024:6.1f}MB/s\") for t in data]"
    else
      ssh $NAS_HOST "curl -s --unix-socket $QBT_SOCK -X POST http://localhost/api/v2/auth/login -d 'username=admin&password=$QBT_PASSWORD' -c /tmp/qbt_cookie >/dev/null && curl -s --unix-socket $QBT_SOCK -b /tmp/qbt_cookie http://localhost/api/v2/torrents/info" | python3 -c "import sys,json; data=json.load(sys.stdin); [print(f\"{t['name'][:60]:60} {t['state']:12} {t['progress']*100:5.1f}% {t['dlspeed']/1024/1024:6.1f}MB/s\") for t in data if t['progress'] < 1.0]"
    fi

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill performs remote SSH, SCP, and qBittorrent API actions without any explicit warning, approval step, or dry-run mode. In this skill context, network transmission and remote state changes are expected, but the lack of disclosure and confirmation makes accidental remote actions and unintended file transfer more likely.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

The add operation inserts untrusted user input directly into a single-quoted remote shell command: -d 'urls=$2' inside the SSH command string. A magnet value containing a single quote can break quoting and inject arbitrary commands on the NAS, turning an expected API request into remote command execution.

Content

Scanner excerpt · nas-download.sh (reported line 23)May include surrounding context.

sh
;;
  add)
    if [[ "$2" =~ ^magnet: ]]; then
      ssh $NAS_HOST "curl -s --unix-socket $QBT_SOCK -X POST http://localhost/api/v2/auth/login -d 'username=admin&password=$QBT_PASSWORD' -c /tmp/qbt_cookie && curl -s --unix-socket $QBT_SOCK -b /tmp/qbt_cookie -X POST http://localhost/api/v2/torrents/add -d 'urls=$2'"
      echo "Magnet link added"
    elif [[ -f "$2" ]]; then
      scp "$2" $NAS_HOST:/tmp/torrent.tmp

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The implementation exceeds the stated capability by accepting a local file path, copying that file to the NAS, and uploading it to qBittorrent, while the manifest only discloses magnet-link handling. This is dangerous because it broadens data access and exfiltration behavior beyond user expectations, increasing the chance that a local sensitive file is transmitted to the remote host without informed consent.

Content

No source excerpt is available for this finding.