Back to skill

Security audit

Tushare A股数据

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed Tushare stock-data connector with expected token and network use, though users should handle the API token carefully and note the unpinned Python dependencies.

Install only in an environment where calling Tushare Pro is expected. Prefer configuring TUSHARE_TOKEN through an environment variable or secret manager rather than pasting it into chat or invocation JSON, and consider pinning dependencies or using a locked environment for reproducible installs.

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
requirements.txt:1
Finding

Unbounded and Unverified Third-Party Dependencies

Content
View full analysis
=1.2.89 pandas>=1.5.0 ``` `metadata.json:16-17`: ```json "tushare>=1.2.89", "pandas>=1.5.0" ``` `README.md:91`: ```bash pip install tushare pandas ``` ### Technical Analysis The project specifies only minimum dependency versions and places no upper bounds on accepted releases. It also provides no lockfile, package hashes, or integrity-verification procedure. The documented installation command resolves whichever package versions are current at installation time. As a result, the installed code may differ from the dependency versions present when the skill was audited. Python packages can execute code during installation and when imported. This project imports both dependencies at process startup, including `tushare` through the following logic in `__init__.py`: ```python import pandas as pd try: import tushare as ts TUSHARE_AVAILABLE = True except ImportError: TUSHARE_AVAILABLE = False ``` This finding does not establish that the current `tushare` or `pandas` releases are malicious. The vulnerability is the absence of reproducible and integrity-verified dependency resolution, which creates an exploitable supply-chain path if an accepted future release or package distribution channel is compromised. ### Attack Path 1. An attacker compromises an upstream dependency publisher account, package release process, or package distribution channel. 2. The attacker publishes a malicious version of `tushare` or `pandas` that still satisfies the open-ended version requirement. 3. A user or deployment platform installs the project using `requirements.txt`, the metadata dependency declarations, or the documented `pip install tushare pandas` command. 4. The package re ...[truncated 1105 chars]
Remediation
View remediation
pandas== ``` 2. Generate a hash-locked dependency file using a controlled tool such as `pip-compile --generate-hashes`, and install it with hash enforcement: ```bash python -m pip install --require-hashes -r requirements.lock ``` 3. Keep `metadata.json` consistent with the reviewed dependency versions rather than using unrestricted minimum versions. 4. Change the README installation instructions to use the project's locked dependency file instead of installing the latest available packages: ```bash python -m pip install --require-hashes -r requirements.lock ``` 5. Configure package installation to use an approved package index or internal mirror, and prohibit fallback to untrusted indexes. 6. Perform automated dependency vulnerability and provenance checks in CI. Review, test, and regenerate hashes explicitly before accepting dependency upgrades. 7. Run the skill in a least-privilege environment with restricted filesystem and network access. Provide `TUSHARE_TOKEN` only at runtime and avoid exposing unrelated secrets to the process. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (11)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 149)May include surrounding context.

md
3. **更新文档**:同步更新 `README.md` 和本文件 (`SKILL.md`) 中的接口列表和描述。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 158)May include surrounding context.

md
3. **更新文档**:同步更新 `README.md` 和本文件 (`SKILL.md`) 中的接口列表和描述。

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README explicitly instructs users to pass the Tushare token in invocation JSON, which can expose credentials through chat history, agent logs, telemetry, screenshots, saved examples, or downstream debugging output. In an agent-skill context, this is more dangerous than ordinary CLI documentation because users may paste secrets into shared orchestration layers where request bodies are retained or visible to other components.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation explicitly instructs users to pass the Tushare token in invocation JSON, which can expose credentials through logs, chat history, telemetry, screenshots, or downstream tooling that records request parameters. In an agent/skill environment, invocation arguments are often more broadly observable than environment variables or secret stores, so this guidance increases the likelihood of accidental secret leakage.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This Python file makes network calls via ts.pro_api(self.token) and then invokes remote API methods with api_method(**kwargs). Although the behavior is central to the skill's purpose, the code contains no confirmation prompt, logging, or comment/docstring warning that request parameters and the provided token will be transmitted to an external service.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The description and tags are entirely in Chinese, with no indication that users can choose another language or that the skill is limited to a Chinese-language or region-specific audience. This creates a natural-language policy concern because the skill metadata appears to impose a locale/language preference without explicit opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring, inline guidance, and user-visible error/help strings are written entirely in Chinese, with no indication that users may choose another language. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Confidence
50% confidence
Finding

Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Content

Scanner excerpt · __init__.py (reported line 183)May include surrounding context.

python
raise Exception(f"Tushare接口 '{api_name}' 不存在。请检查接口名称。")
        
        try:
            api_method = getattr(self.pro, api_name)
            result = api_method(**kwargs)
            
            if result is None:

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

The dependency specification for tushare uses a lower-bound constraint only, which allows installation of any newer release, including unreviewed or potentially breaking versions. This weakens supply-chain control and can expose deployments to vulnerable or malicious upstream releases if dependency resolution changes over time.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
tushare>=1.2.89
pandas>=1.5.0

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
98% confidence
Finding

The pandas dependency is not pinned to an exact version, so builds are not reproducible and may pull in unexpected future releases. This creates a supply-chain risk because security posture can change between installs, and affected versions may be selected without visibility or testing.

Content

Scanner excerpt · requirements.txt (reported line 2)May include surrounding context.

text
tushare>=1.2.89
pandas>=1.5.0

Unverifiable Dependency: pandas has 1 known advisory(ies) (CVE-2020-13091 (** DISPUTED ** pandas through 1.0.3 can unserialize and execute commands from an)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

Content

No source excerpt is available for this finding.