Back to skill

Security audit

Stock Unified

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a read-only market-data skill, with documentation gaps around extra market features, outbound requests, and unpinned Python dependencies.

Install only in an isolated Python environment, preferably with pinned dependency versions. Expect stock symbols, index names, and related query metadata to be sent to third-party market-data providers such as Sina, Eastmoney, pytdx servers, and akshare-backed endpoints. Review the extra futures, U.S. index, market-breadth, sentiment, and fund-flow features if you expected an A-share-only skill.

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:16
Finding
Unpinned Third-Party Dependencies## Vulnerability Details **File Location**: `SKILL.md:16-20` **Vulnerability Type**: Supply-chain risk from unpinned dependencies **Risk Level**: Medium **Complete Code Snippet**: ```markdown ## 安装依赖 ```bash pip install pytdx akshare requests pandas ``` ``` ### Technical Analysis The documented installation command installs four third-party packages without version constraints or integrity hashes. Consequently, the packages and transitive dependencies installed can change over time without any corresponding change to the reviewed Skill. Package installation may execute package build hooks or other installation-time code with the privileges of the user running `pip`. If a future release or transitive dependency is compromised, users following this instruction could execute attacker-controlled code. The current audit found no evidence that the named dependencies are intentionally malicious; the issue is the absence of reproducible, integrity-verified dependency resolution. ### Attack Path 1. An attacker compromises one of the named packages, its release process, its package-index account, or a transitive dependency. 2. The attacker publishes a malicious release that remains compatible with the unrestricted package names. 3. A user follows the documented `pip install` command. 4. Package resolution selects and downloads the compromised release. 5. Malicious installation hooks or imported package code execute with the installing user's privileges. ### Impact Assessment Successful exploitation could provide arbitrary code execution under the account running the installation or Skill. Depending on that account's privileges, an attacker could read or modify accessible files, access user-level credentials, alter application behavior, or establish further persistence. The impact is normally limited to the installing user's permissions unless installation is performed with elevated privileges.
Remediation
## Remediation Suggestions 1. Add a reviewed dependency manifest with exact versions for every direct and transitive dependency. 2. Generate and verify cryptographic hashes, then install with: ```bash python -m pip install --require-hashes -r requirements.txt ``` 3. Use an automated lock-file workflow to ensure reproducible resolution. 4. Configure the official, trusted package index explicitly and disallow unexpected supplemental indexes. 5. Scan locked packages for known vulnerabilities and review dependency updates before merging them. 6. Install dependencies in an isolated virtual environment as an unprivileged user; do not use system-wide or administrative installation unless required. 7. Regenerate the lock file and hashes only through a controlled dependency-update process.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (13)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The declared purpose is limited to A-share stock data, but the detected behavior expands into additional market data and analytics domains including international futures, U.S. indices, trend analysis, sentiment/breadth metrics, and northbound capital flow analysis. Capability drift like this is dangerous because it obscures the real operational scope of the skill, making risk review, user consent, and policy enforcement incomplete.

Lp3

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding
The skill advertises executable workflows using Python scripts, package installation, and multiple remote data sources, but it does not declare any explicit tool scope or permissions for shell and network access. This creates a least-privilege and review gap: an agent may be allowed to invoke capabilities that users and platform policy cannot clearly inspect or constrain.

Natural-Language Policy Violations

Medium
Confidence
90% confidence
Finding
The manifest description and the main skill content are entirely in Chinese, with no indication that users may interact in another language or that the skill is intentionally restricted to a Chinese-speaking or region-specific audience. Per the policy, forcing a specific language without opt-in is a natural-language policy violation.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
"""调用 unified_stock.py CLI 并解析 JSON 输出"""
    try:
        cmd = [sys.executable, SCRIPT] + list(args) + ["--json"]
        r = subprocess.run(cmd, capture_output=True, text=True, timeout=15)
        out = r.stdout.strip()
        # 尝试提取首个 { } JSON 块
        m = re.search(r"\{.*\}", out, re.DOTALL)
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Natural-Language Policy Violations

Medium
Confidence
92% confidence
Finding
The file’s natural-language interface, usage examples, help text, and output strings are written entirely in Chinese, which effectively constrains user interaction to a single language. The policy allows locale constraints only when clearly documented and justified or when users are given a choice, neither of which is present here.

External Transmission

Medium
Category
Data Exfiltration
Content
EASTAPI_BASE = "https://datacenter.eastmoney.com/api/data/v1/get"
EAST_HEADERS = {
    "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36",
    "Referer": "https://data.eastmoney.com/",
}

SINA_BASE = "https://hq.sinajs.cn"
Confidence
80% confidence
Finding
This code is hardwired to send requests to external market-data services, meaning user query inputs and request metadata are transmitted outside the local environment. In a skill ecosystem, that can be dangerous if users are not clearly informed, if execution occurs in sensitive environments, or if outbound network access is not expected.

Description-Behavior Mismatch

Medium
Confidence
97% confidence
Finding
The manifest description limits the skill to A股实时行情、K线历史、板块排行与成分股、财务数据、板块搜索等股票-related scenarios. The code adds a separate international futures capability via Sina mappings and retrieval logic, which is outside the described A-share stock scope rather than an implementation detail of stock data access.

Description-Behavior Mismatch

Medium
Confidence
96% confidence
Finding
The manifest describes a unified stock interface for A-share use cases, but this section fetches U.S. indices such as DJI, IXIC, INX, NDX, and SOX. That broadens the skill from A股 data access into cross-market international index tracking, which is not stated in the manifest.

Description-Behavior Mismatch

Medium
Confidence
89% confidence
Finding
The manifest names real-time quotes, K-line history, sector rankings/components, financial data, and sector search. The code additionally computes market breadth, sentiment scoring, and northbound fund-flow summaries, which are analytics capabilities beyond the manifest’s declared stock-query scenarios.

External Transmission

Medium
Category
Data Exfiltration
Content
'klt': '101', 'lmt': days + 2,
            'ut': 'b2884a393a59ad64002292a3e90d46a5',
        }
        headers = {'User-Agent': 'Mozilla/5.0', 'Referer': 'https://data.eastmoney.com/hsgt/index.html'}
        
        all_rows = []
        for secid in ['1.0001', '1.0003']:  # 北向沪 + 北向深
Confidence
79% confidence
Finding
The northbound capital-flow feature also performs external requests to Eastmoney, extending outbound transmission beyond the core stock quote functionality. The security concern is not the specific URL itself but the undisclosed remote dependency and transmission of user-triggered requests to third parties.

Natural-Language Policy Violations

Low
Confidence
90% confidence
Finding
The module docstring and inline descriptions are written in Chinese, which can impose a specific language/locale on users or maintainers without any opt-in or justification visible in this file. The policy requires avoiding forced language constraints unless choice or clear justification is provided.

Missing User Warnings

Low
Confidence
82% confidence
Finding
The code invokes another Python script via subprocess.run, which is a safety-relevant operation under the audit criteria. In this file there is no confirmation prompt, print/log disclosure, or explicit warning to the user that an external command will be executed.

Missing User Warnings

Low
Confidence
82% confidence
Finding
The module description and CLI examples present the tool as a local stock-data interface without clearly warning that user-supplied symbols/codes will be transmitted to multiple third-party services. While the transmitted data is usually low sensitivity, undisclosed network access can violate user expectations, privacy requirements, or restricted-environment policies.

Static analysis

No suspicious patterns detected.