Back to skill

Security audit

同花顺股票接口

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent stock-market data analysis helper, with install and scope caveats but no hidden persistence, credential use, destructive behavior, or account-changing actions found.

Install in a virtual environment and consider pinning thsdk to a reviewed version instead of using --upgrade. Expect network calls to THS/Wencai market-data services and Chinese/China-market oriented outputs. Treat analysis as informational market data, not investment 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
SKILL.md:86
Finding
Unpinned Third-Party Dependency Installation## Vulnerability Details **File Location**: `SKILL.md`, lines 86–92 **Vulnerability Type**: Unpinned and unverified third-party dependency **Risk Level**: Medium **Vulnerable Code Snippet**: ```bash pip install --upgrade thsdk ``` ```markdown > Package source: [PyPI](https://pypi.org/project/thsdk/) ``` ### Technical Analysis The installation instructions use `--upgrade` without specifying a reviewed package version or verifying package hashes. Consequently, users receive whichever `thsdk` release is current at installation time rather than the version assessed during development. The example programs import `THS` from this package and execute its functionality. If the package, its publisher account, or its dependency chain were compromised, a malicious release could execute code during installation or when the examples instantiate and use `THS`. Merely naming PyPI as the package source does not provide artifact integrity or ensure that future releases remain trustworthy. ### Attack Path 1. An attacker compromises the `thsdk` publisher account, package release process, or dependency chain. 2. The attacker publishes a malicious version that becomes the latest available release. 3. A user follows the documented `pip install --upgrade thsdk` instruction. 4. The package manager downloads and installs the malicious release without version or hash validation. 5. Malicious installation hooks or runtime code execute when the package is installed, imported, or used by the supplied examples. ### Impact Assessment Exploitation could execute code with the permissions of the user running `pip` or the example scripts. Depending on that user's environment and privileges, the compromised dependency could read or modify accessible files, access process environment data, falsify financial-analysis results, make unauthorized network requests, or install additional malicious components. The repository itself contains no observed malicious payload. Exploitation depends o ...[truncated 79 chars]
Remediation
## Remediation Suggestions 1. Pin `thsdk` to a specifically reviewed version rather than installing the latest release: ```text thsdk==REVIEWED_VERSION ``` 2. Record cryptographic hashes in a requirements file and enforce verification: ```bash pip install --require-hashes -r requirements.txt ``` 3. Commit a lock file or fully resolved dependency manifest so transitive dependencies are reproducible. 4. Document the verified publisher and official source repository, and compare release artifacts against the reviewed source. 5. Review dependency updates before changing the pinned version. Use automated vulnerability and provenance scanning as part of that review. 6. Prefer installation in an isolated virtual environment with minimal filesystem and credential access. Avoid running package installation or examples with administrative privileges.
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
96% confidence
Finding
声明描述的是一个覆盖广泛的“高级股票分析”技能,重点包含分钟级K线、盘口深度、分时、跨品种市场、资讯,以及多股票对比可视化分析。实际代码却是 `examples/05_wencai_nlp.py`,核心接口是 `ths.wencai_nlp(...)`,用途集中在自然语言条件查询:涨停/异动/资金流向/行业板块/财务指标/技术形态等问财筛选。虽然其中有少量 `ths.klines(..., interval="day")` 的配合使用,但仅用于候选股的日线均线验证,不构成声明中的分钟K线分析能力。代码也没有任何盘口深度、分时、热力图、归一化走势图、跨市场资产、资讯快讯相关实现。因此,描述显著高估并偏离了该代码块的实际能力,属于明显不匹配。

Vague Triggers

Medium
Confidence
91% confidence
Finding
This markdown file defines when the skill must be used, so SQP-1 applies. The trigger list in the description includes very broad terms like “资讯” and “快讯,” which are common user intents and may cause the skill to activate for loosely related requests without clear scope boundaries or exclusions.

Natural-Language Policy Violations

Medium
Confidence
88% confidence
Finding
SQP-3 applies to all file types and covers language or locale policy violations. The file consistently instructs behavior in Chinese and provides Chinese-only user-facing phrasing, but does not indicate that users may choose another language or that the Chinese-only constraint is intentional and justified.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The module docstring presents the skill scenario, outputs, and usage context only in Chinese. This can violate a language/locale policy when no user opt-in or justification for a Chinese-only experience is provided.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The module docstring and subsequent user-facing labels are written entirely in Chinese, indicating the skill is designed to operate in a specific language without offering a language or locale choice. 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.

Natural-Language Policy Violations

Low
Confidence
93% confidence
Finding
The file’s user-facing natural-language description is entirely in Chinese and does not offer any language choice or indicate that the skill is region-specific by design. Under the policy rule, forcing a specific language without opt-in is a natural-language policy concern.

Natural-Language Policy Violations

Low
Confidence
94% confidence
Finding
The module docstring describes all scenarios exclusively in Chinese, which constitutes a natural-language locale choice embedded in the skill. Under the policy, language constraints should either offer a user choice or be clearly documented as justified for a region-specific tool; that justification is not present in this file.

Static analysis

No suspicious patterns detected.