Back to skill

Security audit

My Skill

Security checks for vulnerabilities and agentic risk

Overview

The main bot appears to do paper trading, but the package also includes inconsistent metadata and an unrelated shell-based chat runner with a command-injection risk.

Review this carefully before installing. The main CLI looks like a simple paper-trading simulator, not a live trading bot, but the package contains an unrelated vulnerable chat runner and inconsistent manifest text. Do not run artifact/index. with untrusted input, and only use run.sh if you intend an endless local paper-trading loop.

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

T09 · Insecure Skill Coding Practices

Error
Location
index.:3
Finding

Shell Command Injection Through User-Controlled Chat Input

Content
View full analysis

Vulnerability Details

File Location: index., lines 3–13
Vulnerability Type: OS command injection
Risk Level: High

Vulnerable Code

js
const { execSync } = require("child_process");

function askOllama(prompt) {
  try {
    const result = execSync(
      `ollama run gemma3:1b "${prompt.replace(/"/g, '\\"')}"`,
      { encoding: "utf8", stdio: ["pipe", "pipe", "ignore"] }
    );

    return result.trim();
  } catch (err) {
    return "Error menjalankan Ollama";
  }
}

The user-controlled data reaches this function through the following code at lines 19–21 and 30–35:

js
const args = process.argv.slice(2);
const command = args[0];
const input = args.slice(1).join(" ");

case "chat":
  console.log({
    type: "chat",
    input,
    reply: askOllama(input)
  });

Technical Analysis

The chat command's arguments are concatenated into input and passed to askOllama(). That function interpolates the input into a command string executed by child_process.execSync(), which invokes a shell.

The code escapes only double quotation marks. This does not prevent shell evaluation within a double-quoted argument. Shell constructs such as command substitution using $(...) or backticks can consequently be evaluated before ollama receives the prompt. Merely escaping quotation marks is not a reliable defense against shell command injection.

The vulnerable index. file is not the CLI entry point configured in package.json; that entry point is index.js. Exploitation therefore requires the auxiliary file to be invoked directly or integrated as an executable. Nevertheless, it is bundled executable-style code and contains a directly exploitable sink when used.

Attack Path

  1. An attacker gains the ability to influence the argument supplied to the auxiliary file's chat command.
  2. The attacker embeds a shell expression such as $(id) in the prompt.
  3. main() joins the arguments and passes the resulting string to `askOllama ...[truncated 845 chars]
Remediation
View remediation

Remediation Suggestions

Avoid invoking a shell for this operation. Pass the executable and each argument separately:

js
const { execFileSync } = require("child_process");

function askOllama(prompt) {
  try {
    const result = execFileSync(
      "ollama",
      ["run", "gemma3:1b", prompt],
      {
        encoding: "utf8",
        stdio: ["pipe", "pipe", "ignore"],
        timeout: 30000
      }
    );

    return result.trim();
  } catch {
    return "Unable to run Ollama";
  }
}

Alternatively, use spawnSync() with an argument array and explicitly set shell: false.

Additional hardening should include:

  1. Remove index. from the distributed package if it is obsolete or unused.
  2. Enforce reasonable prompt-length limits to reduce denial-of-service risk.
  3. Set an execution timeout and output-size limit for the child process.
  4. Run Ollama with the least-privileged account and a restricted environment.
  5. Add regression tests containing shell metacharacters and substitutions, including $(...), backticks, semicolons, quotes, and newlines, verifying that they are passed as literal prompt data.
  6. Do not attempt to secure shell-string construction through ad hoc escaping; use non-shell process APIs throughout.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (14)

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The advertised purpose is a crypto trading bot, but the implementation is only a generic wrapper that forwards user input to a local LLM. This capability mismatch is dangerous because it misrepresents what the skill does, can mislead users and reviewers, and may conceal unreviewed or unnecessary functionality behind a benign-looking description.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script places trading commands for BTC, ETH, and SOL in an infinite loop every 30 seconds with no user confirmation, rate limiting, safety checks, or kill switch. In a trading bot context this is especially dangerous because it can repeatedly place unintended orders, amplify losses during volatility, and rapidly drain account balances if the underlying skill misbehaves or is misconfigured.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The manifest claims this is a generic 'CLI skill test' with a 'Basic skill runner' description, while the surrounding skill metadata presents it as a trading bot for BTC, ETH, and SOL. This mismatch is dangerous because misleading metadata can conceal the skill’s real purpose from reviewers and users, reducing scrutiny and enabling risky or unauthorized behavior to be introduced under an innocuous label.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill launches a local shell command via execSync even though its stated purpose does not require arbitrary subprocess execution. Invoking a shell with dynamically constructed command text increases attack surface and can enable command injection or abuse of local system resources if input handling is bypassed or incomplete.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

User-controlled input is interpolated into a shell command string before being passed to execSync, with only double quotes escaped. This is insufficient shell escaping and can allow command injection through shell metacharacters such as backticks or command substitution, resulting in arbitrary local command execution.

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 · index.js (reported line 36)May include surrounding context.

js
}
async function getPrice(symbol) {
  const res = await axios.get(
    `https://api.binance.com/api/v3/ticker/price?symbol=${symbol}USDT`
  );
  return parseFloat(res.data.price);
}

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest describes an AI trading bot for BTC, ETH, and SOL, which would reasonably require market-data/network libraries, but not necessarily an Ethereum wallet and smart-contract interaction library. The inclusion of ethers indicates capability for on-chain account management and transaction signing that goes beyond the stated trading-bot purpose as described in the manifest.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The description line is written in Indonesian while the rest of the skill documentation is primarily in English. This imposes a language choice on users without documenting an opt-in or offering alternatives, which matches the language/locale policy concern for natural-language content.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The error message string is fixed in Indonesian ("Error menjalankan Ollama"), which imposes a specific language on users without opt-in or locale selection. This is a natural-language policy issue because the skill does not provide a language choice or document a justified locale restriction.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill writes trading state and history to local JSON files, including balances, positions, and trade history, but the code does not document or warn that local files will be created or modified. This affects user data on disk and qualifies as a file-write operation lacking visible disclosure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill makes a network call to Binance using the user-provided symbol, which transmits user input to an external service. While this is functionally expected for a price lookup, the code provides no comment, docstring, or explicit user-facing notice that external API requests occur.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
92% confidence
Finding

The dependency uses a caret version range, which allows automatic installation of newer compatible releases instead of a single audited version. This increases supply-chain risk because a compromised or breaking upstream release could be pulled into the trading bot environment without explicit review.

Content

Scanner excerpt · package.json (reported line 8)May include surrounding context.

json
"my-skill": "./index.js"
  },
  "dependencies": {
    "axios": "^1.18.0",
    "dotenv": "^17.4.2",
    "ethers": "^6.17.0"
  }

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
92% confidence
Finding

The dotenv package is specified with a caret range, so future installs may resolve to different versions than were originally tested. In a bot that may handle API keys, wallet settings, or other secrets, this creates avoidable supply-chain exposure if an upstream release is malicious or vulnerable.

Content

Scanner excerpt · package.json (reported line 9)May include surrounding context.

json
},
  "dependencies": {
    "axios": "^1.18.0",
    "dotenv": "^17.4.2",
    "ethers": "^6.17.0"
  }
}

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

The ethers dependency is not pinned to a single exact version, allowing compatible upstream releases to be installed automatically. Because this is a trading bot and ethers is commonly used for wallet, signing, or blockchain transaction logic, a compromised or flawed release could directly affect fund-handling behavior and increases the severity of the supply-chain risk.

Content

Scanner excerpt · package.json (reported line 10)May include surrounding context.

json
"dependencies": {
    "axios": "^1.18.0",
    "dotenv": "^17.4.2",
    "ethers": "^6.17.0"
  }
}