Back to skill

Security audit

TradingBot

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly transparent about installing TradingBot, but it downloads and runs mutable GitHub code and starts a management service that may be reachable beyond the local machine.

Install only if you are comfortable running the current upstream TradingBot code and its npm/Go build steps with your user account permissions. Prefer reviewing or pinning a trusted commit first, keep the port firewalled, avoid exposing it to public networks, and do not add live exchange credentials unless you deliberately move beyond demo mode.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T03 · Remote Payload Retrieval and Execution

Error
Location
scripts/install.sh:5
Finding

Unpinned Remote Source Is Built and Subsequently Executed

Content
View full analysis
/dev/null || true)" case "$origin_url" in "$REPO_URL"|"https://github.com/paoosi/tradingbot"|"git@github.com:paoosi/tradingbot.git") ;; *) fail "Target directory origin is not paoosi/tradingbot: ${origin_url:-not configured}" ;; esac if [[ -n "$(git -C "$TARGET_DIR" status --porcelain)" ]]; then fail "The target repository contains uncommitted changes" fi git -C "$TARGET_DIR" pull --ff-only elif [[ -e "$TARGET_DIR" ]]; then if [[ ! -d "$TARGET_DIR" || -n "$(find "$TARGET_DIR" -mindepth 1 -maxdepth 1 -print -quit 2>/dev/null)" ]]; then fail "The target path exists and is not an empty directory or target Git repository" fi git clone --depth 1 "$REPO_URL" "$TARGET_DIR" else git clone --depth 1 "$REPO_URL" "$TARGET_DIR" fi mkdir -p "$TARGET_DIR/bin" "$TARGET_DIR/data" "$TARGET_DIR/logs" ( cd "$TARGET_DIR/web" npm ci npm run build ) ( cd "$TARGET_DIR" go build -o bin/server ./cmd/server go build -o bin/worker-supervisor ./cmd/worker-supervisor go build -o bin/strategy-runner ./cmd/strategy-runner ) ``` The generated binary is subsequently executed by `scripts/run.sh`: ```bash exec "$TARGET_DIR/bin/server" ``` ### Technical Analysis The installation process clones or updates the current state of a remote Git branch without pinning it to a reviewed commit, signed tag, or release artifact. It also does not verify a cryptographic checksum or Git signature before building the downloaded content. The effective payload can therefore change after the Skill package itself has been audited. In add ...[truncated 1678 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/run.sh:34
Finding

Management Service Is Not Restricted to the Loopback Interface

Content
View full analysis
` only tells the local user which URL to open; it does not prevent the process from also accepting connections through LAN, VPN, container, or other host interfaces. Advising users to retain firewall protection is not equivalent to enforcing a secure bind address. ### Attack Path 1. A user installs and launches TradingBot under the assumption that it is a local-only demonstration service. 2. The server starts on port 8088 and binds to all available network interfaces. 3. A host on a reachable LAN, VPN, container network, or other connected network discovers or directly accesses the port. 4. The remote host reaches the management UI or API. 5. The remote host probes authentication and application endpoints or exploits any weakness in the upstream web service. 6. If such an application-level weakness exists, the attacker may access or manipulate data and operations exposed by the TradingBot service. ### Impact Assessment The immediate impact is expansion of the se ...[truncated 530 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill metadata and behavior are misaligned: it claims install/run/check capabilities, while the described workflow also initializes local secrets and configuration, and the static finding notes gaps around actual startup/health-check behavior. This mismatch is dangerous because operators may approve or invoke the skill under incomplete assumptions, causing unreviewed side effects such as secret generation, repo modification, or network-exposed service setup.

Content

No source excerpt is available for this finding.

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 · scripts/install.sh (reported line 82)May include surrounding context.

sh
# 该脚本从本地私有配置启动完整服务;不会读取或打印任何交易所密钥。
TARGET_DIR="${1:-${TRADINGBOT_INSTALL_DIR:-$PWD/tradingbot}}"
ENV_FILE="$TARGET_DIR/.env.local"

if [[ ! -f "$TARGET_DIR/bin/server" || ! -f "$TARGET_DIR/bin/strategy-runner" ]]; then
  printf '错误: 构建产物不完整,请先运行 install.sh\n' >&2

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 · scripts/run.sh (reported line 6)May include surrounding context.

sh
# 该脚本从本地私有配置启动完整服务;不会读取或打印任何交易所密钥。
TARGET_DIR="${1:-${TRADINGBOT_INSTALL_DIR:-$PWD/tradingbot}}"
ENV_FILE="$TARGET_DIR/.env.local"

if [[ ! -f "$TARGET_DIR/bin/server" || ! -f "$TARGET_DIR/bin/strategy-runner" ]]; then
  printf '错误: 构建产物不完整,请先运行 install.sh\n' >&2

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill clearly instructs the agent to execute shell commands (bash .../scripts/install.sh, bash .../scripts/run.sh, curl ...) but does not declare any explicit tool scope such as allowed shell usage. This creates a governance gap: downstream systems or reviewers cannot reliably constrain or audit what command execution authority the skill expects, increasing the risk of unintended or overbroad code execution.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

L004 的注释称脚本“只负责克隆/更新、生成本地配置和构建,不会启动服务或配置真实交易账户”。但后续在 L082-L095 中实际创建了 .env.local,写入 APP_ENV=production、JWT_SECRET、APP_SECRET_KEY、SQLITE_PATH 等运行时配置与密钥材料,这已超出单纯“构建”的含义。虽然没有直接写入交易所账号凭据,但注释对脚本副作用的表述明显弱化了其真实行为。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script's user-facing comments and error/output strings are written exclusively in Chinese, including failure messages and status text. This imposes a specific language on users without offering a language choice or documenting a justified locale restriction, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/install.sh (reported line 97)May include surrounding context.

sh
printf '%s\n' 'export EMBEDDED_WORKER_ENABLED="true"'
  } >"$env_file"
fi
chmod 600 "$env_file"

commit_sha="$(git -C "$TARGET_DIR" rev-parse HEAD)"
printf 'TradingBot 构建完成\n'

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

L04 的注释明确表示“不会读取或打印任何交易所密钥”,但 L19 使用 source "$ENV_FILE" 载入 .env.local 中的全部变量。若该文件包含交易所 API key/secret,这些敏感值会被实际读取进进程环境,即使后续没有打印,也与注释的“不会读取”表述直接矛盾。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The short description is written in Chinese while the default prompt is in English, and the file does not indicate any user language preference or opt-in. This can create a language/locale policy concern because the skill presents fixed language choices rather than explicitly adapting to the user's selected language.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.