Back to skill

Security audit

AMtkSkill

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent A-share market-data tool that fetches from Tushare, stores local datasets, and queries or analyzes them as described.

Install only if you are comfortable providing a Tushare token, making authenticated requests to Tushare, and storing downloaded market data locally. For safer use, run it in a constrained project directory, avoid sharing the .env file, and use pinned or locked dependency versions where possible.

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/amtk_fetch.py:1
Finding

Unpinned Runtime Dependencies Permit Supply-Chain Compromise

Content
View full analysis
=3.13" # dependencies = [ # "pandas>=2.2.3", # "pyarrow>=16.1.0", # "python-dotenv>=1.0.1", # "tushare>=1.4.24", # "openpyxl>=3.1.5", # ] # /// ``` `scripts/amtk_query.py:1-8` and `scripts/amtk_analyze.py:1-8`: ```python # /// script # requires-python = ">=3.13" # dependencies = [ # "pandas>=2.2.3", # "pyarrow>=16.1.0", # "python-dotenv>=1.0.1", # "tushare>=1.4.24", # ] # /// ``` `SKILL.md:20-22`: ```markdown 检查依赖: ```! uv sync ``` ``` ### Technical Analysis The scripts use PEP 723 dependency metadata with lower-bound-only constraints. For example, `tushare>=1.4.24` allows any later version accepted by the resolver. The audited project does not contain a lockfile or dependency hashes that bind execution to previously reviewed artifacts. The documented `uv run` and `uv sync` workflows may therefore resolve and download package versions that were not present during the audit. If a permitted package release or configured package index is compromised, the dependency can introduce attacker-controlled code. Several dependencies are imported directly during normal operation, so malicious module initialization code would execute with the privileges of the process running the Skill. This issue is especially relevant to `tushare` and `python-dotenv`, because the fetch workflow loads `TUSHARE_TOKEN` into the process environment. A compromised dependency imported in that process could read and exfiltrate the token, inspect locally stored market data, or perform other actions allowed to the Agent account. The audit found no evidence that the current source intentionally retrieves or ...[truncated 1523 chars]
Remediation
View remediation
", # "pyarrow==", # "python-dotenv==", # "tushare==", # "openpyxl==", # ] ``` 2. Commit a generated `uv.lock` file and require locked or frozen dependency resolution in documented commands and automation. 3. Configure `uv` to use an explicitly trusted package index rather than inheriting arbitrary user or environment index configuration. 4. Verify package artifacts with hashes or another supported integrity-verification mechanism. 5. Review and update dependencies through a controlled process that includes vulnerability scanning and source or artifact provenance checks. 6. Run the fetch workflow in a restricted environment with access only to the project data directory, the Tushare credential, and required network destinations. 7. Keep `TUSHARE_TOKEN` narrowly scoped and rotate it immediately if dependency compromise is suspected. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The declared description presents a broader analytics skill: fetch from Tushare, query行情估值, and perform technical analysis. The supplied code chunk only defines command-line entry points for initializing, resuming, and incrementally updating fetched A-share data, plus fetching stock lists and showing a dataset overview. Those fetching capabilities are consistent with part of the description, but the advertised query/valuation and technical-analysis capabilities are not represented in this code. Therefore the description does not accurately match this specific code chunk's actual behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The description promises three main capabilities: fetching data from Tushare, querying market/valuation data, and technical analysis. The supplied code only demonstrates the second category: querying and summarizing existing local data through CLI subcommands. Although Tushare is listed as a dependency, there is no visible network fetch logic in this chunk. Likewise, there is no implementation of moving averages, RSI, MACD, or Bollinger Bands. The code's actual purpose is a local data query interface, so the description overstates capabilities not evidenced here.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The declared description promises both data acquisition and higher-level analysis/query capabilities. This code chunk only covers the fetching pipeline: obtaining stock lists, configuring batch jobs, running full or incremental Tushare downloads, and reporting results. The Tushare fetching portion is consistent with the description, but the advertised行情估值查询 and technical analysis capabilities are absent from this code. Since the actual primary behavior here is ETL/batch sync rather than analysis, the description does not accurately represent this supplied code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The declared description says the skill can fetch A-share data from Tushare and perform technical analysis indicators. This code chunk does neither. It strictly loads and filters local partitioned Parquet/CSV data, merges daily datasets, and provides simple query helpers like stock search, cross-section, and top movers. The 'query行情估值' portion is partially consistent because it can load market_daily and daily_basic data and expose them for querying, but the key advertised capabilities—Tushare fetching and indicator-based technical analysis—are absent from the supplied code. Therefore the description materially overstates what this code chunk actually does.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
75% confidence
Finding

The skill uses 'env' capability that is not listed in its permissions. This may indicate deceptive intent or missing permission declarations.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The script clearly invokes functionality that will make outbound network requests via the Tushare client in fetcher.pipeline and fetcher.stock_basic, but the file’s script metadata only declares Python/package dependencies and does not declare any explicit network permission. In an agent skill environment, undeclared network access is dangerous because it bypasses user/operator expectations and can enable unexpected external communication, even if the apparent purpose is fetching market data.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/fetcher/common.py (reported line 24)May include surrounding context.

python
def load_project_dotenv() -> None:
    dotenv_path = PROJECT_ROOT / ".env"
    if not dotenv_path.exists():
        return

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/fetcher/common.py (reported line 56)May include surrounding context.

python
resolved_token = token or os.getenv("TUSHARE_TOKEN")
    if not resolved_token:
        raise RuntimeError(
            "Missing Tushare token. Set TUSHARE_TOKEN in .env or pass --token YOUR_TOKEN."
        )

    ts.set_token(resolved_token)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The activation guidance is broad enough that an agent may invoke the skill for many A-share-related requests without clearly distinguishing between read-only analysis and state-changing fetch/update operations. That can lead to unnecessary external calls, dependency installation, or local data writes when the user only asked for conceptual or lightweight assistance.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill requires a TUSHARE_TOKEN and fetches data from an external service, but it does not prominently disclose that credentials and query activity will be used for outbound requests. In security-sensitive environments, undisclosed third-party communication increases risk around secret handling, auditability, and user expectations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs use of fetch commands that store market data locally, but it does not clearly warn users that invoking these operations will write files to disk. Hidden persistence changes are security-relevant because they affect data retention, disk usage, and possibly compliance expectations in environments where local writes should be deliberate.

Content

No source excerpt is available for this finding.