Back to skill

Security audit

agent-stock

Security checks for vulnerabilities and agentic risk

Overview

This skill is purpose-aligned for stock analysis, but it asks agents to install unpinned third-party code and save sensitive trading or holdings reports without clear user consent or financial-risk warnings.

Install only if you trust the `agent-stock` package source and are comfortable with the agent downloading and running Python package code. Treat all trading outputs as informational, verify them independently, avoid providing brokerage credentials or unnecessary account details, and require explicit confirmation before saving holdings or trading reports locally.

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

T08 · Insecure Dependencies

Warning
Location
SKILL.md:35
Finding

Unpinned Third-Party Package Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 35-48
Vulnerability Type: Unpinned and unverified third-party dependency installation
Risk Level: Medium

Vulnerable Code

markdown
If it is not installed, install the `stock` command-line tool first:

**uv:**
```bash
uv tool install agent-stock

pip:

bash
pip3 install agent-stock

If the user does not have uv or pip, first help the user install a Python environment, and then install the agent-stock package with pip.

text

### Technical Analysis

The Skill directs the Agent to install `agent-stock` from the configured Python package index without pinning an audited version, verifying package hashes, using a lockfile, or validating the package source. Consequently, the effective dependency and its behavior may change after this Skill has been reviewed.

Installing a Python package can execute package-controlled build or installation logic. The workflow subsequently invokes the package-provided `stock` executable. Because the dependency source is not included in this project, neither its installation behavior nor its runtime behavior can be verified by this audit.

This creates a supply-chain risk involving a compromised upstream release, package-index substitution, dependency confusion caused by an unsafe private-index configuration, or an unreviewed future package version.

### Attack Path

1. An attacker compromises the `agent-stock` publishing account or causes a malicious package to resolve through the user's configured package index.
2. The Agent finds that the `stock` command is unavailable.
3. Following `SKILL.md`, the Agent runs `uv tool install agent-stock` or `pip3 install agent-stock`.
4. The package manager retrieves an unpinned, attacker-controlled package release.
5. Malicious installation logic may execute during installation, or malicious code may execute when the workflow later invokes the installed `stock` command.
6. The payload operates with the
...[truncated 866 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin agent-stock to a specific version that has been independently reviewed, for example:

    bash
    uv tool install "agent-stock==X.Y.Z"
    
  2. Use a lockfile or hash-verified requirements file. With pip, require hashes for the complete resolved dependency set:

    bash
    pip3 install --require-hashes -r requirements.txt
    
  3. Document and enforce the canonical package index and verified upstream project source. Do not silently rely on arbitrary indexes inherited from user or system configuration.

  4. Require explicit user confirmation before installing packages or a Python runtime. Clearly disclose that third-party code will be downloaded and executed.

  5. Prefer a prebuilt, reviewed environment or container containing the pinned CLI rather than performing installation during Skill execution.

  6. Run the stock CLI with least privilege in a restricted environment. Limit filesystem access, network access, environment-variable exposure, and access to credentials that are not required for stock analysis.

  7. Establish an update process that reviews new package versions before changing the pin, verifies package provenance and hashes, and repeats security testing.

Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (9)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly offers stock selection, trading decisions, and quantitative trading decision support, but it does not include any warning that outputs may be inaccurate, not financial advice, or financially harmful if acted upon. In a high-stakes domain like securities trading, omission of risk disclosures can increase the chance that users over-trust the agent and make loss-inducing decisions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs the agent to save detailed holdings analysis to a local file without any requirement to notify the user or obtain consent first. Because the content includes sensitive financial portfolio data and trading decisions, silent persistence can expose private information to other local processes, future tasks, or unintended retention beyond the current session.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

All instructions, output schema, and required phrasing are specified only in Chinese, and the skill directs a fixed response style without any user opt-in for language or locale. Under the policy, a skill should not implicitly force a specific language unless it offers a choice or clearly documents a justified regional constraint.

Content

No source excerpt is available for this finding.

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · references/quant.md (reported line 34)May include surrounding context.

md
评分完成后,检查维度间是否存在冲突,按以下规则修正总分:

| 冲突类型        | 修正规则                                                                                                   |
| --------------- | ---------------------------------------------------------------------------------------------------------- |
| 资金强+技术超买 | 资金流向≥24分 且 RSI6>75 → 总分-5,标注「资金强但技术超买,需等回调」                                      |
| 资金强+板块弱   | 资金流向≥24分 且 板块共振≤5分 → 总分-3,标注「资金独立行情,板块无共振支撑」                               |

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill instructs the agent to save analysis results to a local file path without any explicit user-facing notice, confirmation, or consent step. In an agent context, silent file writes can create unintended persistence of sensitive trading analysis, stock selections, or user-specific account-derived outputs, especially when filenames may reveal content and timestamps.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

All user-facing descriptive content in the file is written in Chinese, and there is no indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking region or audience. That can constitute a language/locale policy issue because the skill implicitly constrains interaction language without opt-in or justification.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

Manifest 描述聚焦于股市实时数据获取、选股、交易决策、持仓分析和量化决策本身,但该文件进一步要求把结果持久化写入 dist/trade/...。结果落盘不是前述能力的明显必要组成部分,属于新增的状态持久化行为。

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The skill mandates writing trading results to a local file without warning the user that a file will be created, where it will be stored, or whether an existing file could be overwritten. This can lead to unexpected local persistence of potentially sensitive financial analysis and weakens user control over side effects.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill explicitly instructs the agent to write results to a local file under dist/screen/YYYYMMDD_hhmm.md without requiring user awareness, consent, or any notice that disk writes will occur. While the target path appears fixed and low risk, silent file creation can still surprise users, leak sensitive financial analysis to local storage, or violate least-surprise and data-handling expectations.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.