Back to skill

Security audit

tushare-base

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward Tushare helper for reading Chinese market data, with manageable setup risks around token storage and unpinned Python packages.

Install in a virtual environment and consider pinning dependencies. Avoid putting a paid or sensitive Tushare token in a synced dotfile; use a session export, local env file with restrictive permissions, or a secrets manager when 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
SKILL.md:27
Finding
Unpinned Third-Party Dependencies Installed from a Mutable Package Index## Vulnerability Details **File Location**: `SKILL.md`, lines 27-31 **Vulnerability Type**: Unverified and unpinned third-party dependency installation **Risk Level**: Medium **Complete Code Snippet**: ```markdown ### 3. Install dependencies ```bash pip3 install tushare pandas --user ``` ``` ### Technical Analysis The installation instructions retrieve the latest available versions of `tushare` and `pandas` from pip's configured package index without version constraints, cryptographic hashes, a lockfile, or integrity verification. The effective dependency code can therefore change after the Skill has been audited. Python package installation may execute package build or installation logic with the invoking user's privileges. Runtime imports also execute package initialization code. Consequently, compromise of a package release, its distribution account, the configured package index, or a transitive dependency could introduce arbitrary code into the Skill's execution path. The direct `pandas` installation also appears unnecessary because `scripts/market.py` does not import it. Although Tushare may resolve pandas transitively when needed, declaring it directly without a reviewed version unnecessarily broadens the explicit dependency surface. This is a supply-chain weakness rather than evidence that the currently named packages are malicious. ### Attack Path 1. An attacker compromises a dependency publisher, package-index account, configured package mirror, or relevant transitive dependency. 2. The attacker publishes a malicious release under a dependency name that the instructions install without a fixed version. 3. A user follows `SKILL.md` and runs `pip3 install tushare pandas --user`. 4. pip resolves the mutable release and installs it without validating a project-provided hash. 5. Malicious package logic executes during installation or when `scripts/market.py` imports Tushare. 6. The payload runs with the p ...[truncated 592 chars]
Remediation
## Remediation Suggestions 1. Replace the free-form installation command with a reviewed, version-pinned requirements file. 2. Pin every direct and transitive dependency to an exact version. 3. Record approved distribution hashes and install with `pip --require-hashes`. 4. Generate and review a lockfile using a dependency-locking tool. 5. Remove `pandas` as a direct installation instruction unless the project directly requires and imports it. 6. Install dependencies inside an isolated virtual environment rather than the user's shared package directory. 7. Regularly scan locked dependencies for known vulnerabilities and review updates before changing approved versions. 8. Use a trusted package index or controlled internal mirror and require TLS certificate validation. Example hardened workflow: ```bash python3 -m venv .venv . .venv/bin/activate python3 -m pip install --require-hashes -r requirements.txt ```
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (5)

Lp3

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding
The skill requires access to an environment secret (`TUSHARE_TOKEN`) but does not declare any explicit tool scope or permission boundary in the skill metadata. This weakens least-privilege controls and can cause the runtime or users to grant broader access than necessary, increasing the chance of unintended secret exposure or misuse in a skill that executes scripts.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The instructions tell users to place the API token in `~/.zshrc`, which persists the secret in plaintext in a commonly read shell startup file. That increases the risk of accidental disclosure through backups, dotfile syncing, local file reads, shell history/debugging, or other tools and skills that can access user home-directory files.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
This file includes natural-language text that forces a specific language/locale for users, including the module docstring and subsequent command/help text, with no opt-in or alternative language path. Under the policy rule, a hardcoded language choice without user selection is a natural-language policy violation unless clearly justified as region-specific.

Natural-Language Policy Violations

Low
Confidence
94% confidence
Finding
该 Markdown 文档从标题到全部说明均仅使用中文,未说明这是面向特定中文用户群体的区域化文档,也未提供其他语言选项。按照语言/地区政策检查,这属于未给用户选择而默认强制单一语言的自然语言层面问题。

Natural-Language Policy Violations

Low
Confidence
85% confidence
Finding
The entire skill reference is presented only in Chinese, with no indication that users may choose another language or that the locale restriction is required for a region-specific purpose. Under the stated policy, forcing a specific language without user opt-in can be a natural-language policy violation.

Static analysis

No suspicious patterns detected.