Back to skill

Security audit

tqsdk-query

Security checks for vulnerabilities and agentic risk

Overview

The skill is a disclosed read-only TqSdk market-data connector, with ordinary credential and dependency risks users should manage.

Install only in an isolated runtime where only this skill can access TQ_USERNAME and TQ_PASSWORD, prefer pinned and reviewed dependency versions, and treat the configured TqSdk account credentials as sensitive. The inspected code is read-only for market data, but the package currently lacks dependency locking.

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 Third-Party Dependency Versions Create Supply-Chain Risk

Content
View full analysis

Vulnerability Details

File Location: requirements.txt:1-2
Vulnerability Type: Unpinned third-party dependencies
Risk Level: Medium

Vulnerable Code

text
tqsdk>=3.0.0
pandas>=1.3.0

Technical Analysis

Both dependencies use open-ended minimum-version constraints. No lockfile or cryptographic package hashes are present in the audited project. Consequently, separate installations may resolve to different and potentially unreviewed future releases.

Python packages can execute code during installation and when imported. This project imports tqsdk at module initialization, so a compromised release selected by the package resolver could execute with the privileges and environment of the Skill process. This concern is particularly significant because that environment contains the TQ_USERNAME and TQ_PASSWORD credentials used by the Skill.

This finding does not establish that the currently available tqsdk or pandas releases are malicious. It identifies an avoidable supply-chain exposure caused by allowing automatically selected future versions without integrity verification.

Attack Path

  1. An attacker compromises the publishing account, build pipeline, or distribution channel of one of the permitted dependencies.
  2. The attacker publishes a malicious version satisfying tqsdk>=3.0.0 or pandas>=1.3.0.
  3. A new installation or deployment resolves and downloads that version because no exact version or hash is enforced.
  4. Attacker-controlled code runs during package installation or subsequent import.
  5. The malicious code operates under the Skill process identity and may access its environment variables, files, network connectivity, and other resources available to that process.

Impact Assessment

Successful exploitation could provide arbitrary code execution with the privileges of the account or container installing or running the Skill. The accessible scope may in ...[truncated 232 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace open-ended constraints with exact, reviewed versions, for example:
    text
    tqsdk==<reviewed-version>
    pandas==<reviewed-version>
    
  2. Generate and commit a reproducible lockfile through a tool such as pip-tools, Poetry, or uv.
  3. Require cryptographic hashes for all direct and transitive packages, such as with pip install --require-hashes.
  4. Retrieve packages only from an explicitly configured trusted registry or an internally controlled package mirror.
  5. Use automated dependency vulnerability and provenance scanning, while applying upgrades only after review and testing.
  6. Install and execute the Skill in a least-privileged, isolated environment with restricted filesystem and network access.
  7. Expose the TQ credentials only to the runtime process that requires them and rotate them if dependency compromise is suspected.
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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (9)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The entire skill documentation is written only in Chinese, and there is no indication that users may interact in another language or that the skill is intentionally restricted to a Chinese-speaking or region-specific audience. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill documentation explicitly requires sensitive credentials via environment variables, but the manifest does not declare any tool scope or permission boundary indicating env access. This creates a transparency and least-privilege problem: a host may grant broader environment access than users expect, and secret-handling behavior is not clearly constrained or documented in the permission model.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest description, parameter descriptions, usage guidance, and FAQ all assume Chinese as the only interaction language. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest describes a read-oriented interface for real-time quotes and historical futures/options data. While network access to the TqSdk service is expected for that purpose, directly reading sensitive credentials from environment variables is an additional capability not stated in the manifest and not obviously part of the user-facing skill scope.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The skill manifest presents its user-facing description entirely in Chinese, and the file does not state that the skill is intended only for Chinese-speaking users or offer any language/locale choice. Under the natural-language policy rules, forcing a specific language without user opt-in can be a policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The handler retrieves TQ_USERNAME and TQ_PASSWORD from environment variables, which is access to sensitive credentials. While the comment explains this for developers, there is no user-facing warning, confirmation, or disclosure message about credential use before connecting to the external service.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

The dependency specification uses a lower-bound version constraint without an upper bound or exact pin, which makes builds non-reproducible and allows future upstream releases to be installed implicitly. That increases supply-chain risk because a breaking, vulnerable, or compromised release of tqsdk could be pulled in during installation without review.

Content

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

text
tqsdk>=3.0.0
pandas>=1.3.0

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
98% confidence
Finding

The pandas dependency is also unpinned, so installations may resolve to different versions over time. This weakens reproducibility and can expose consumers to newly introduced vulnerable or malicious releases in the package supply chain.

Content

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

text
tqsdk>=3.0.0
pandas>=1.3.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.