Back to skill

Security audit

A股数据获取 A specialized data collection tool for Chinese A-share market

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent A-share market data collector that uses public financial data sources and local storage, with install and resource-use cautions but no evidence of deception, credential access, or exfiltration.

Install only in a virtual environment, do not run pip install sqlite3, and prefer pinned dependencies. Before use, confirm you are comfortable with the fixed D:\xistock storage location, local database/file mutation, optional repair-file deletion prompts, and any cron configuration before adding scheduled jobs or Telegram announcements.

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:186
Finding
Unpinned Dependencies and Incorrect Installation of the Python sqlite3 Standard-Library Module## Vulnerability Details **File Location**: `SKILL.md`, lines 186-190 **Vulnerability Type**: Supply-chain exposure through unpinned dependencies and package-name confusion **Risk Level**: Medium ### Vulnerable Code ```bash pip install requests pip install sqlite3 pip install pandas pip install akshare # Chinese stock data library ``` ### Technical Analysis The installation instructions retrieve third-party packages without version constraints, integrity hashes, or a lock file. Consequently, the code installed by users can change independently of the reviewed Skill package. The instructions also tell users to run `pip install sqlite3`. Python already provides `sqlite3` as a standard-library module, so it should not be installed from a package registry. Resolving a separately published package with the same name creates a package-confusion risk: users may install unrelated or malicious registry content under the mistaken belief that it is the standard Python module. Python packages may execute build or installation logic during installation. A compromised dependency release, malicious same-named package, or compromised configured package index could therefore execute code before the Skill itself runs. No evidence was found that the project intentionally publishes or controls a malicious dependency. This finding concerns the unsafe dependency-installation procedure. ### Attack Path 1. A user follows the installation commands in `SKILL.md`. 2. `pip` resolves packages from PyPI or another package index configured in the user environment. 3. Because no exact versions or hashes are specified, `pip` accepts whichever compatible releases the index currently serves. 4. For `sqlite3`, the resolver may retrieve a third-party distribution rather than use Python’s built-in module. 5. A malicious or compromised distribution executes installation hooks or malicious runtime code. 6. That code runs with the privileges of the user performing the installation. ### Impa ...[truncated 632 chars]
Remediation
## Remediation Suggestions 1. Remove the invalid registry installation instruction: ```bash # Do not run: pip install sqlite3 ``` Use Python’s standard-library `sqlite3` module and document that a Python build with SQLite support is required. 2. Create a reviewed dependency manifest containing exact versions: ```text requests==REVIEWED_VERSION pandas==REVIEWED_VERSION akshare==REVIEWED_VERSION ``` 3. Generate and verify cryptographic hashes for every direct and transitive dependency, then require them during installation: ```bash python -m pip install --require-hashes -r requirements.txt ``` 4. Commit a lock file produced by a dependency-locking tool and update it only through a documented review process. 5. Recommend installation inside an isolated virtual environment rather than a global or administrative Python environment: ```bash python -m venv .venv .venv\Scripts\python -m pip install --require-hashes -r requirements.txt ``` 6. Document the trusted package index explicitly and discourage unreviewed mirrors or extra package indexes. 7. Add automated dependency scanning and periodic review for known vulnerabilities, unexpected ownership changes, and compromised releases.
Vulnerability Patterns
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (41)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
Manual partitioning via CLI arguments and text-file storage contradict the implied fully automatic collector model. In practice this can change who controls execution scope and make the skill easier to misuse for unreviewed batch writes or incomplete data runs presented as authoritative.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
Manual partitioning via CLI arguments and text-file storage contradict the implied fully automatic collector model. In practice this can change who controls execution scope and make the skill easier to misuse for unreviewed batch writes or incomplete data runs presented as authoritative.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
Manual partitioning via CLI arguments and text-file storage contradict the implied fully automatic collector model. In practice this can change who controls execution scope and make the skill easier to misuse for unreviewed batch writes or incomplete data runs presented as authoritative.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
Manual partitioning via CLI arguments and text-file storage contradict the implied fully automatic collector model. In practice this can change who controls execution scope and make the skill easier to misuse for unreviewed batch writes or incomplete data runs presented as authoritative.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
Manual partitioning via CLI arguments and text-file storage contradict the implied fully automatic collector model. In practice this can change who controls execution scope and make the skill easier to misuse for unreviewed batch writes or incomplete data runs presented as authoritative.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
Manual partitioning via CLI arguments and text-file storage contradict the implied fully automatic collector model. In practice this can change who controls execution scope and make the skill easier to misuse for unreviewed batch writes or incomplete data runs presented as authoritative.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
Manual partitioning via CLI arguments and text-file storage contradict the implied fully automatic collector model. In practice this can change who controls execution scope and make the skill easier to misuse for unreviewed batch writes or incomplete data runs presented as authoritative.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
Manual partitioning via CLI arguments and text-file storage contradict the implied fully automatic collector model. In practice this can change who controls execution scope and make the skill easier to misuse for unreviewed batch writes or incomplete data runs presented as authoritative.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
Manual partitioning via CLI arguments and text-file storage contradict the implied fully automatic collector model. In practice this can change who controls execution scope and make the skill easier to misuse for unreviewed batch writes or incomplete data runs presented as authoritative.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
Manual partitioning via CLI arguments and text-file storage contradict the implied fully automatic collector model. In practice this can change who controls execution scope and make the skill easier to misuse for unreviewed batch writes or incomplete data runs presented as authoritative.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding
Manual partitioning via CLI arguments and text-file storage contradict the implied fully automatic collector model. In practice this can change who controls execution scope and make the skill easier to misuse for unreviewed batch writes or incomplete data runs presented as authoritative.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
Manual partitioning via CLI arguments and text-file storage contradict the implied fully automatic collector model. In practice this can change who controls execution scope and make the skill easier to misuse for unreviewed batch writes or incomplete data runs presented as authoritative.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
Manual partitioning via CLI arguments and text-file storage contradict the implied fully automatic collector model. In practice this can change who controls execution scope and make the skill easier to misuse for unreviewed batch writes or incomplete data runs presented as authoritative.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
Manual partitioning via CLI arguments and text-file storage contradict the implied fully automatic collector model. In practice this can change who controls execution scope and make the skill easier to misuse for unreviewed batch writes or incomplete data runs presented as authoritative.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
Manual partitioning via CLI arguments and text-file storage contradict the implied fully automatic collector model. In practice this can change who controls execution scope and make the skill easier to misuse for unreviewed batch writes or incomplete data runs presented as authoritative.

Lp3

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding
The skill documents capabilities that imply filesystem reads/writes and outbound network access, but it does not declare any tool scope or permission boundaries. In an agent environment, undeclared powerful capabilities reduce reviewability and can let a seemingly simple data skill perform broader local or remote actions than users expect.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The documentation includes a reset command that appears destructive but does not clearly warn about data loss or state reset consequences. In an agent or copy-paste usage context, this creates a realistic risk of accidental database corruption, forced re-fetches, or loss of operational state by users who interpret it as routine maintenance.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The manifest describes a specialized collector that fetches and stores stock historical data. This script instead performs broad maintenance actions: creating backup copies, altering the SQLite schema, deleting duplicate DB rows, nulling timestamps to force refresh, creating directories, deleting local files, and generating repair reports. Those are materially different operational behaviors from simple collection/storage.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
This code emits nearly all runtime status, warnings, help examples, and remediation guidance in Chinese, including the CLI help text and operational messages. Because the skill does not provide any user opt-in or locale selection mechanism, it imposes a specific language on all users, which matches the language/locale policy violation criteria.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The manifest describes a stock data collector that automatically fetches and stores daily/weekly/monthly historical K-line data in a SQLite database. In this file, the fetched historical bars are written to text files under DATA_DIR, while the database is only used to read the stock list and update the day_get timestamp, so the implementation does not match the stated storage behavior.

Intent-Code Divergence

Medium
Confidence
98% confidence
Finding
The top-level usage/documentation promises a maximum of 100 incremental stocks per run, but the implementation can process up to 1000. This mismatch is security-relevant because operators may schedule or parallelize the job under false assumptions, leading to unexpectedly heavy network activity, API abuse, disk growth, and degraded system availability.

Intent-Code Divergence

Medium
Confidence
96% confidence
Finding
The code contradicts its own documented execution limit by allowing up to 10x more stocks than the stated per-run maximum. In an automated data collection skill, this kind of hidden expansion can materially increase runtime, outbound requests, and operational load, creating denial-of-service, rate-limit, or resource exhaustion risk for the host or upstream service.

Intent-Code Divergence

Medium
Confidence
95% confidence
Finding
The function docstring states it processes only BATCH_SIZE stocks per run, while the loop actually processes every batch in the eligible stock set. In this skill context, that misleading claim can cause unsafe operational assumptions about execution time and request volume, especially since the script is designed to run in parallel processes against an external financial API.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
This code emits operational status and warning messages in Chinese only throughout the script, which imposes a specific language on users without opt-in or configuration. The file contains bilingual top-level documentation, but the runtime interface itself does not provide a locale switch or alternative output language.

Description-Behavior Mismatch

Medium
Confidence
89% confidence
Finding
The manifest describes a stock data collector that fetches and stores historical K-line data in a SQLite database. In this file, fetched data is written to frequency-specific text files under D:\xistock\day/week/month, while the database is only updated with last-fetch timestamps rather than storing the historical K-line payload itself. This expands behavior beyond the manifest's stated SQLite-only storage model.

Static analysis

No suspicious patterns detected.