Back to skill

Security audit

股票九剑

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed A-share stock analysis tool that fetches market data, computes indicators, and optionally creates charts, with manageable dependency and network-use cautions.

Install it in a dedicated virtual environment, avoid elevated shells, and consider pinning dependencies before use. Expect it to contact market-data sources through akshare and to write chart PNGs when chart generation is requested. Treat its stock output as analysis support, not financial advice.

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
scripts/requirements.txt:1
Finding

Unpinned and Unverified Third-Party Dependencies Are Installed and Executed

Content
View full analysis
=1.12.0 pandas>=1.5.0 numpy>=1.24.0 mplfinance>=0.12.10 matplotlib>=3.7.0 ``` `SKILL.md:160`: ```bash pip install akshare pandas numpy mplfinance matplotlib ``` `mcp_server/PLATFORM_CONFIGS.md:52`: ```bash pip install akshare pandas numpy mplfinance matplotlib mcp ``` `mcp_server/PLATFORM_CONFIGS.md:233`: ```bash npx @anthropic-ai/mcp dev E:/独孤九剑/.claude/skills/股票九剑/mcp_server/server.py ``` `mcp_server/PLATFORM_CONFIGS.md:241-242`: ```text | Startup error `ModuleNotFoundError: mcp` | `pip install mcp` | | Startup error `ModuleNotFoundError: akshare` | `pip install akshare pandas numpy mplfinance matplotlib` | ``` ### Technical Analysis The project directs users to retrieve dependencies from public Python and npm registries and immediately install or execute them. The Python requirements specify only minimum versions using `>=`, with no upper bounds, exact version pins, integrity hashes, lockfile, or documented package provenance. Consequently, a future installation may resolve to dependency versions that were never reviewed with this project. The documented `npx @anthropic-ai/mcp dev` command is particularly sensitive because `npx` may download and immediately execute a registry-hosted package when a suitable local version is unavailable. The command does not pin an exact package version or validate package integrity before execution. No evidence was found that any currently named dependency is malicious. The vulnerability is the absence of controls that ensure users execute the same reviewed dependency artifacts over time. This creates exposure to compromised maintainer a ...[truncated 1849 chars]
Remediation
View remediation
pandas== numpy== mplfinance== matplotlib== mcp== ``` 2. Generate a hash-locked dependency file and require integrity verification: ```bash python -m pip install --require-hashes -r requirements.lock ``` 3. Use a dependency-locking workflow such as `pip-tools`, Poetry, or an equivalent tool that records all transitive dependency versions and hashes. 4. Pin the npm package to an explicitly reviewed version rather than allowing dynamic resolution: ```bash npx --yes @anthropic-ai/mcp@ dev ``` 5. Verify the correct npm package identity and publisher before documenting the command. Where possible, install it from an organization-controlled lockfile rather than downloading it during testing. 6. Instruct users to create a dedicated virtual environment: ```bash python -m venv .venv .venv/bin/python -m pip install --require-hashes -r requirements.lock ``` On Windows, use `.venv\Scripts\python.exe`. 7. Recommend non-administrative installation and execution. Explicitly warn users not to run `pip` or `npx` from an elevated shell. 8. Add automated dependency scanning, provenance verification, and periodic review of both direct and transitive dependencies before updating the lockfile. ]]>
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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (28)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description promises a concrete stock-analysis capability with input handling, automatic data retrieval, computation, and analysis. However, the provided code chunk does not implement any of these behaviors; it is only an initialization file containing a comment. This is a material mismatch because the actual supplied code does not substantiate the declared primary purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

代码与描述存在明显的描述-行为不一致。描述把该技能定义为一个完整的 A 股短线分析工具,会在接收股票代码后自动完成数据获取、特征计算、招式匹配和结论输出;而当前代码块的实际职责只是‘数据获取层’。它调用 akshare 获取多个市场数据源,对字段做标准化,并通过 fetch_all 聚合结果,最后通过 CLI 打印或导出 JSON。虽然‘自动获取数据’这一部分与描述一致,但描述中的核心价值——九剑分析方法本身——在代码中完全缺失。因此其主要目的与实际行为不完全一致,属于实质性能力缺失型 mismatch。

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill invokes Python scripts that fetch market data and may access network resources, but the manifest declares no explicit tool scope or permissions. This creates an authorization gap where the agent may perform external data access without transparent user-facing restriction or platform-enforced limits.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The description does not clearly warn users that the skill will automatically fetch external market data and may search news or announcements. Missing disclosure weakens informed consent and transparency, making it easier for the skill to perform external actions the user may not expect.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

A broad trigger such as plain '股票九剑' can activate the skill on casual mentions rather than a deliberate request to analyze a stock. That can cause unintended execution of scripts, external data fetching, or other side effects without clear user intent, which is especially risky in a skill that may access networked market data.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill tells the agent to search for latest announcements or news even though the manifest presents a stock-analysis workflow centered on user-supplied codes and scripted data retrieval. This broadens the skill into open-ended web information gathering, increasing the chance of unnecessary external requests, prompt injection from untrusted web content, and privacy/scope violations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This markdown file presents all instructions and operational guidance exclusively in Chinese, and it does not indicate that the user can choose another language. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is clearly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown file is entirely written in Chinese and the embedded prompt templates instruct the agent in Chinese only, with no indication that users may choose another language. Under the policy rule for language/locale, this is a natural-language constraint that lacks opt-in or explicit justification as a region-specific limitation.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The MCP skill's user-facing instructions are entirely in Chinese, and the tool names/descriptions throughout the file likewise assume Chinese-only use. There is no indication that users may choose another language or that the skill is intentionally restricted to a Chinese-language audience for a documented regional/compliance reason.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This Python file contains user-facing natural-language content entirely in Chinese, including the module description and later CLI output strings, with no indication that the skill is region-specific or that users can opt into another language. Under the policy, forcing a specific language without user choice is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The command-line usage, error messages, and analysis output are all hard-coded in Chinese, and the script exposes no flag or setting to choose another language. This is a direct language/locale policy issue because the file dictates a single language for end users without explicit opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This code file contains prominent natural-language instructions and descriptions entirely in Chinese, presenting the skill as Chinese-only with no indication that users can opt into another language. Under the language/locale policy rule, forcing a specific language without user choice can be a policy violation unless clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The module docstring and user-facing descriptions are entirely in Chinese, presenting the skill as Chinese-specific without offering any language selection. This is a natural-language locale policy concern because the skill appears to enforce a specific language by default rather than documenting it as optional or region-scoped.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

All command-line prompts and status messages are emitted in Chinese, and the file provides no indication that users can opt into another language. For a general-purpose skill, this constitutes a language policy issue because it forces a locale-specific interaction style.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This manifest/config file contains user-facing comments and descriptive labels exclusively in Chinese, with no indication that other languages are supported or that the locale is intentionally constrained. Under the policy rule, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Rp1

Low
Category
MCP Rug Pull
Confidence
60% confidence
Finding

pip install without ==version installs the latest release, which could include malicious changes.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The only natural-language content in this file is the Chinese title '独孤九剑 · MCP Server'. Because the skill does not provide any user opt-in or explanation for a language-specific constraint, it may violate the policy against forcing a specific language or locale.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

L44-L46 的文档将空头排列写为“MA5 < MA8 < MA13 > MA21”,其中最后一个比较方向与标准空头排列及下方实际代码逻辑不一致。L67-L69 的实现实际要求 MA5 < MA8 < MA13 < MA21,因此注释/文档会误导调用方对该特征含义的理解。

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

L233-L234 的文档说明“接近压力位/支撑位”定义为在 5% 以内,但 L243-L244 实际以小于 3% 作为 near_high_20d 和 near_low_20d 的判定条件。这里不是简单的文档不完整,而是阈值定义直接矛盾,会改变策略信号含义。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This Python file is a code file, so only SQP-2 and SQP-3 apply. The module docstring, CLI usage text, and all user-facing recommendations are written in Chinese, and the script does not provide any opt-in or locale selection mechanism, which can violate language/locale policy requirements when users have not chosen Chinese output.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

The dependency is specified with a lower bound only, which allows future unreviewed versions of akshare to be installed. This weakens build reproducibility and increases supply-chain risk because security regressions or malicious upstream compromises could be pulled in without deliberate review.

Content

Scanner excerpt · scripts/requirements.txt (reported line 1)May include surrounding context.

text
akshare>=1.12.0
pandas>=1.5.0
numpy>=1.24.0
mplfinance>=0.12.10

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
98% confidence
Finding

Using pandas>=1.5.0 leaves the resolved version open-ended, so deployments may install different releases over time. That creates non-reproducible environments and can expose the skill to newly introduced vulnerable or compromised versions from the package ecosystem.

Content

Scanner excerpt · scripts/requirements.txt (reported line 2)May include surrounding context.

text
akshare>=1.12.0
pandas>=1.5.0
numpy>=1.24.0
mplfinance>=0.12.10
matplotlib>=3.7.0

Unverifiable Dependency: pandas has 1 known advisory(ies) (CVE-2020-13091 (** DISPUTED ** pandas through 1.0.3 can unserialize and execute commands from an)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
87% confidence
Finding

Because pandas is not pinned, it is impossible to determine from this manifest whether an affected version with a known advisory could be installed. In this skill's context, the risk is somewhat limited because the file is only a requirements manifest, but unresolved version selection still leaves exposure uncertain.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
98% confidence
Finding

The numpy dependency is not exactly pinned, so any later version satisfying the constraint may be installed. This expands the attack surface for supply-chain issues and makes it harder to verify whether known advisories affect the runtime environment.

Content

Scanner excerpt · scripts/requirements.txt (reported line 3)May include surrounding context.

text
akshare>=1.12.0
pandas>=1.5.0
numpy>=1.24.0
mplfinance>=0.12.10
matplotlib>=3.7.0