Back to skill

Security audit

股票

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to be a stock-market data helper, but it can automatically install or upgrade a third-party Python package during normal use, which is a supply-chain and environment-change risk.

Review before installing. This skill is not clearly malicious, but you should only use it in an isolated environment where automatic pip installs are acceptable. Prefer manually installing a pinned, reviewed thsdk version, avoid running it with sensitive local credentials, and treat THS username/password/MAC values as secrets.

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/stock_utils.py:48
Finding

Automatic Installation and Upgrade of an Unpinned Third-Party Dependency

Content
View full analysis
bool: """ Install or upgrade the thsdk library. """ try: pkg = f"thsdk=={version}" if version else "thsdk" print(f"[stock_utils] Installing {pkg}...") result = subprocess.run( [sys.executable, "-m", "pip", "install", "--upgrade", pkg], capture_output=True, text=True ) if result.returncode == 0: print("[stock_utils] thsdk installed successfully") return True else: print(f"[stock_utils] thsdk installation failed: {result.stderr}") return False except Exception as e: print(f"[stock_utils] thsdk installation exception: {e}") return False ``` The automatic installation is invoked when the installed version is considered too old or the package is missing: ```python if v_parts < min_parts: print( f"[stock_utils] thsdk version is too old " f"({version} < {THSDK_MIN_VERSION}); upgrading..." ) return install_thsdk() ... except ImportError: print("[stock_utils] thsdk is not installed; installing...") return install_thsdk() ``` The same unsafe behavior is explicitly prescribed in `SKILL.md`: ```bash pip install --upgrade thsdk ``` ### Technical Analysis The Skill automatically invokes pip during normal operation and requests the latest available release of `thsdk` whenever the package is absent or below the minimum version. The installation does not use: - An exact, audited version pin for the default installation path - A dependency lock file - Package or artifact hashes - An explicitly approved package index - Verification of transitive dependencies - User confirmation be ...[truncated 2168 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (16)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

声明描述的核心能力是“股票代码/名称解析 + 多类市场数据获取接口封装”,而实际代码的核心用途是“获取基础/K线数据后进行技术分析与可视化”。虽然两者都与股票数据相关,并且代码确实使用了 THS/thsdk 风格接口获取部分数据,但声明中的多项关键功能在代码中完全缺失,包括名称/缩写转换、候选选择、资金流向、自动安装等。相反,代码主要实现了技术指标计算、图表绘制和分析报告输出,这属于与声明不同的主要用途,因此构成明显描述-行为不一致。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

There is a clear mismatch between the declared description and the actual code. The description claims a functional stock-market data skill backed by thsdk with multiple finance-related capabilities and code normalization behavior. The actual code is a minimal example script whose only effect is printing a placeholder string. It does not access market data, perform lookups or conversions, call APIs, install dependencies, or implement any of the described behavior. Therefore the declared purpose does not accurately represent the supplied code chunk.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill documents shell-capable behavior by instructing automatic execution of pip install --upgrade thsdk, yet it declares no tool scope or permission boundaries. In an agent setting, undeclared shell access increases the risk of unexpected command execution and supply-chain exposure because the agent may modify the host environment without explicit approval.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

A skill presented as passive stock-data retrieval also modifies the runtime by automatically installing or upgrading dependencies. This broadens the trust boundary and can surprise users or operators, especially in agent environments where environment mutation may enable persistence, break reproducibility, or introduce malicious dependencies.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
80% confidence
Finding

The manifest description is entirely in Chinese and specifically emphasizes Chinese-name lookup and related Chinese-market interactions, while the file does not indicate that users may choose another language. This can violate language/locale policy when a skill effectively forces a specific language without opt-in.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill explicitly includes automatic package installation via pip, giving it an execution and environment-modification capability beyond simple data retrieval. This is dangerous because it introduces supply-chain risk, can change system state unexpectedly, and may execute installer code from external packages during normal skill use.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill describes automatic pip installation without a clear warning that it will modify the system, download code, and potentially execute package installation scripts. Lack of informed consent is risky in security-sensitive agent workflows because users may trigger environment changes unintentionally.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module description, user-facing print strings, and chart labels are all hard-coded in Chinese, indicating the skill is designed to communicate in a specific language by default. This can violate language/locale policy when no user choice or documented locale constraint is provided.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation explicitly demonstrates providing sensitive THS account credentials and a device identifier both inline and via environment variables, but it gives no warning about secret handling, storage, logging, shell history exposure, or avoiding hardcoded credentials. In the context of a financial-data skill that may be run by agents or users in shared environments, this can lead to credential leakage, unauthorized API access, and account/device misuse.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The module-level documentation and all user-facing messages are written exclusively in Chinese, indicating the skill is designed to operate in a single language. Under the policy, forcing a specific language without user opt-in or a documented region-specific justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This skill contains built-in logic to auto-install or upgrade Python packages via pip despite being a stock-data utility. That capability is broader than necessary for its business purpose and introduces supply-chain risk, arbitrary third-party code execution during install, and unexpected modification of the local environment.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
95% confidence
Finding

The code invokes pip at runtime via subprocess to install or upgrade a package in the host Python environment. Even though the package name is mostly fixed, this still creates a supply-chain and environment-modification risk during normal execution, allowing unreviewed code to be fetched and installed from package indexes and changing the runtime outside the skill's stated data-retrieval purpose.

Content

Scanner excerpt · scripts/stock_utils.py (reported line 62)May include surrounding context.

python
pkg = f"thsdk=={version}" if version else "thsdk"
        print(f"[stock_utils] 正在安装 {pkg}...")
        
        result = subprocess.run(
            [sys.executable, "-m", "pip", "install", "--upgrade", pkg],
            capture_output=True,
            text=True

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The normal execution path calls ensure_thsdk(), which will trigger installation or upgrade of thsdk whenever the package is missing or deemed too old. This means simply using the skill can modify the interpreter environment and download code from external sources, increasing operational and supply-chain exposure.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The helper that obtains a THS instance implicitly relies on ensure_thsdk(), which may install or upgrade packages, but this side effect is not surfaced as a clear operational/security boundary in the skill behavior. Hidden environment mutation reduces transparency and can lead operators to execute the skill in contexts where package installation is forbidden or dangerous.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
67% confidence
Finding

Most operational guidance, prompts, and example outputs are written only in Chinese, and the output examples assume Chinese-language interaction. Because no opt-in or alternative locale is provided, the skill may impose a language choice on users.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The plotting configuration explicitly sets Chinese-capable fonts and disables unicode minus issues for that locale, reinforcing a fixed Chinese presentation mode. Because no opt-in or fallback based on user preference is provided, this creates a locale-specific behavior that is not clearly justified in-file.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.