Back to skill

Security audit

Stock Tools

Security checks for vulnerabilities and agentic risk

Overview

This stock watchlist skill is mostly purpose-aligned, but its bundled local script can overwrite arbitrary writable files through an unrestricted file-path option.

Install only if you are comfortable with a local Node script that reads and writes watchlist files. Avoid using or exposing the --file option, keep the skill limited to its dedicated stocks-data/stocklist.txt file, and confirm before any clear/reset request. The public quote network call is expected for latest A-share prices.

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

Warning
Location
scripts/stock_tools.js:10
Finding

Arbitrary File Overwrite Through Unrestricted --file Option

Content
View full analysis
`${item.code}|${item.name}`).join('\n'); fs.writeFileSync(file, content ? `${content}\n` : '', 'utf8'); } ``` ```js function clearStocks(file) { writeStockList(file, []); } ``` ```js if (command === 'clear') { clearStocks(file); console.log('Watchlist cleared'); return; } ``` The original status message is written in Chinese, but this does not affect the vulnerability. ### Technical Analysis The `--file` argument accepts an arbitrary relative or absolute path and normalizes it with `path.resolve()`. Normalization does not constrain the path to the intended `stocks-data` directory. No canonical-path containment check, allowed-directory policy, symlink check, file-type validation, or overwrite confirmation is applied. The resulting path is passed to `writeStockList()`, which creates missing parent directories and invokes `fs.writeFileSync()`. The `clear` command supplies an empty list, causing the selected file to be truncated to zero bytes. The `add` and `remove` commands can likewise replace the selected file with attacker-influenced watchlist content. This is a direct arbitrary-file-write primitive within the permissions of the process ru ...[truncated 1777 chars]
Remediation
View remediation
Vulnerability Patterns
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (7)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

If the underlying tool really supports a user-controlled --file parameter for arbitrary path selection, that creates a filesystem write/read primitive beyond the documented stocks-data/stocklist.txt scope. In an agent setting, undocumented arbitrary file access can be abused to overwrite or read unintended workspace files, especially because the trigger language encourages natural-language invocation rather than constrained administrative use.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

If the underlying tool really supports a user-controlled --file parameter for arbitrary path selection, that creates a filesystem write/read primitive beyond the documented stocks-data/stocklist.txt scope. In an agent setting, undocumented arbitrary file access can be abused to overwrite or read unintended workspace files, especially because the trigger language encourages natural-language invocation rather than constrained administrative use.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The activation language is broad enough to capture ordinary stock-market conversation, which can cause the agent to invoke external network/tool actions when simple discussion was intended. Overbroad triggers increase the risk of unnecessary data access, unintended side effects, and user confusion about when persistence or external calls occur.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

Broad destructive phrases like 'clear' or 'reset' tied to persistent local state without explicit confirmation requirements can lead to unintended deletion of the user's watchlist. In an agent workflow, ambiguous destructive triggers are risky because natural-language requests may be misinterpreted and cause irreversible state changes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The clear command overwrites the persisted watchlist with an empty file immediately and provides no confirmation, dry-run, backup, or undo path. In an agent skill context, a mistaken natural-language mapping, prompt injection, or accidental invocation could cause irreversible loss of user data even though the script itself is not malicious.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The manifest description and operational examples are primarily in Chinese and imply a Chinese-language interaction pattern, but there is no explicit user opt-in or documented locale constraint. Under the stated policy, forcing a specific language without choice can be a natural-language policy issue unless clearly justified.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

Examples like '删除 000009' and especially '去掉 000533' are terse and could overlap with ordinary editing or cleanup requests if context is not perfectly established. The file does not provide negative examples clarifying that these phrases should only trigger within a stock-watchlist context.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.