Back to skill

Security audit

Tushare 期货数据

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed Tushare futures-data connector; its notable risks are token-handling hygiene and unpinned dependencies, not hidden or destructive behavior.

Install only if you are comfortable giving the skill a Tushare API token and allowing it to send queries to Tushare. Prefer setting TUSHARE_TOKEN through your environment or secret manager rather than pasting the token into chat-visible JSON. For stronger supply-chain assurance, pin or lock the Python dependency versions before installation.

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

Unpinned Third-Party Dependencies Permit Unreviewed Package Updates

Content
View full analysis
=1.2.89 pandas>=1.5.0 ``` `metadata.json:11`: ```json "packages": ["tushare>=1.2.89", "pandas>=1.5.0"] ``` `README.md:12-13`: ```text bash pip install tushare pandas ``` ### Technical Analysis The project specifies only minimum dependency versions and does not impose upper bounds, exact versions, package hashes, or a reproducible lockfile. The README further instructs users to install the packages without any version constraints. Consequently, package installation may retrieve any future version accepted by the package resolver. Python packages can execute code during installation and import. This project imports both dependencies at module initialization in `__init__.py`: ```python import pandas as pd ``` ```python import tushare as ts ``` If an allowed future release is compromised, malicious code could execute inside the skill process before normal request processing. This process may contain the user-provided `TUSHARE_TOKEN` environment variable and has the same filesystem and network privileges as the skill runtime. The finding does not establish that the currently published `tushare` or `pandas` packages are malicious. The risk arises from permitting unreviewed future releases without integrity verification. ### Attack Path 1. An attacker compromises the release process or distribution account of one of the declared packages and publishes a malicious version higher than the specified minimum. 2. A user installs the project dependencies using `pip install -r requirements.txt` or follows the README command `pip install tushare pandas`. 3. Because no exact version or hash is enforced, the resolver selects the attacker-controlled release. 4. Malicious ...[truncated 1008 chars]
Remediation
View remediation
pandas== ``` 2. Generate and commit a reproducible lockfile containing hashes for all direct and transitive dependencies. Use tooling such as `pip-compile --generate-hashes`. 3. Enforce integrity verification during installation: ```bash pip install --require-hashes -r requirements.lock ``` 4. Update `metadata.json` so its package declarations match the reviewed exact versions. 5. Replace the README command with installation from the hash-locked dependency file rather than unconstrained package names. 6. Configure package installation to use a trusted, explicitly selected package index. Avoid untrusted additional indexes that could introduce dependency-confusion risks. 7. Add automated dependency vulnerability and provenance scanning to the release process. Review and regenerate the lockfile deliberately when upgrades are required. 8. Run the skill under a least-privileged, isolated runtime with restricted filesystem access and controlled outbound networking to reduce the impact of a dependency compromise. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
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
95% confidence
Finding

The README explicitly instructs users to place their Tushare token directly in JSON call parameters, which increases the likelihood that secrets will be captured in logs, chat transcripts, request histories, or debugging output. In an agent or skill context, structured invocation payloads are especially likely to be persisted or echoed, making credential exposure more likely than with environment-based configuration alone.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation explicitly recommends passing the Tushare token in invocation JSON as an accepted configuration path, but it does not warn that request parameters are commonly logged, stored in chat history, surfaced in debugging output, or retained by orchestration systems. In an agent-skill context, that increases the chance of credential exposure and unauthorized reuse of the token, even though the token itself is not executed code.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

No manifest is available, so there is no declared purpose or scope that would justify reading credentials from the runtime environment. The code explicitly pulls TUSHARE_TOKEN from os.environ, which gives the skill access to ambient secrets beyond explicit user-supplied input.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

A file-wide natural-language policy issue exists because the documentation assumes Chinese as the required language and does not provide opt-in, alternatives, or justification for the locale restriction. Under the stated policy, forcing a specific language without user choice can be a violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

This code accesses the sensitive TUSHARE_TOKEN environment variable to authenticate outbound API use, but there is no confirmation prompt, logging, or user-facing warning at the point of use. In a code-file review, credential access without visible disclosure can warrant a missing-warning finding when the behavior is not otherwise disclosed in the file.

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 56)May include surrounding context.

python
if not hasattr(self.pro, api_name) and api_name != "trade_cal":
            raise Exception(f"接口 '{api_name}' 不存在")
        
        api_method = self.pro.query if api_name == "trade_cal" else getattr(self.pro, api_name)
        
        try:
            result = api_method(**kwargs)

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
94% confidence
Finding

The dependency specification uses a lower-bound only version constraint for tushare, which makes builds non-reproducible and allows future upstream releases to be installed without review. If a compromised or breaking release is published, consumers of this skill could unknowingly pull it in during installation.

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
97% confidence
Finding

The pandas dependency is also specified with only a minimum version, so installations may resolve to different versions over time. This increases supply-chain risk and makes it harder to verify whether the deployed package is free of known vulnerabilities or malicious updates.

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
79% confidence
Finding

The manifest does not pin pandas, so it is impossible to determine from this file alone whether an affected version tied to the cited advisory could be installed. While the referenced advisory is disputed and may not apply in many environments, the lack of version pinning prevents reliable vulnerability assessment and could permit installation of an older vulnerable release depending on the resolver and environment.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.