Back to skill

Security audit

tqsdk

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent trading-SDK skill, but it needs Review because its examples can place live trades and handle account credentials without adequate safeguards.

Review carefully before installing. Use a sandbox, simulation, or backtest account by default; never put production trading passwords in prompts, source files, or logs; pin and review dependencies; and require explicit user confirmation before any code calls insert_order, cancel_order, TargetPosTask, or live-account APIs.

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 Allow Unreviewed Package Releases

Content
View full analysis
=3.0.0 pandas>=1.5.0 ``` `demo_project/README.md:6-10`: ```markdown 1. Ensure that the dependencies are installed: ```bash pip install -r ../requirements.txt ``` ``` `SKILL.md:15-20`: ```markdown ## Installation ```bash pip install tqsdk ``` ``` ### Technical Analysis The dependency manifest specifies only minimum versions and does not impose upper bounds or exact versions. The primary installation documentation is even less restrictive because it installs `tqsdk` without any version constraint. No lock file or package hashes are supplied to verify the exact artifacts being installed. Consequently, following the documented installation process can install future dependency releases that were not available or reviewed when this Skill was published. Python packages may execute code during installation or when imported. The demo imports `tqsdk`, while the broader Skill expects TqSdk to receive account credentials, connect to external trading services, and submit orders. This does not establish that the current upstream packages are malicious. The vulnerability is the absence of reproducible, integrity-verified dependency resolution, which expands the impact of an upstream package compromise, malicious release, or unexpected incompatible update. ### Attack Path 1. An attacker compromises a dependency publisher account, upstream release process, or package distribution channel for `tqsdk`, `pandas`, or a transitive dependency. 2. The attacker publishes a malicious version satisfying `>=3.0.0` or `>=1.5.0`. 3. A user follows the documented `pip install` command. 4. Pip resolves and installs the malicious or otherwise unreviewed release because no exact vers ...[truncated 1224 chars]
Remediation
View remediation
pandas== ``` 2. Generate and commit a lock file that includes all transitive dependencies. 3. Require cryptographic hashes during installation. For example, generate a fully resolved requirements file using `pip-compile --generate-hashes` and install it with: ```bash pip install --require-hashes -r requirements.lock ``` 4. Configure pip to use an explicitly approved package index and trusted internal mirror where appropriate. Do not add untrusted extra package indexes. 5. Review release notes, source changes, package ownership, and artifact provenance before updating pinned versions. 6. Run dependency installation and the demo in an isolated virtual environment or container under a non-privileged account. 7. Keep production trading credentials out of development and installation environments. Provide them only at runtime through a dedicated secret manager with narrowly scoped access. 8. Add automated dependency scanning and controlled update tooling, but require security review and testing before merging version changes. 9. Update `SKILL.md` and `demo_project/README.md` so all installation examples reference the integrity-verified lock file rather than unconstrained `pip install tqsdk`. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (11)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation includes executable order-placement and cancellation examples in a trading SDK quick reference without any prominent warning that these calls can trigger real trades when used with a live account. In the context of a finance/trading skill, this is especially dangerous because users often copy-paste examples directly, and the same API surface supports both simulation and production execution.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The credential setup instructs users to pass account credentials directly in code or environment variables without warning about password sensitivity, storage hygiene, or transmission to the trading service. This can lead to credential leakage through source control, logs, screenshots, shell history, or insecure deployment practices, especially when copied by agents or novice users.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The README includes a direct live order placement example against a real trading API without any warning that the code can place real-money trades. In the context of a trading skill, this materially increases the chance that a user or downstream agent will run the example verbatim and unintentionally submit market-impacting or financially risky orders.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The examples instruct users to pass usernames and passwords directly in code via TqAuth("user", "pass") without any warning about secret handling. In an agent setting, this encourages hardcoded credentials that may be stored in chat logs, notebooks, repositories, or generated files, increasing the risk of credential leakage and subsequent unauthorized access to market data or trading accounts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This section gives concrete live order-placement examples against a real trading API, including market and limit orders, cancellation, and order status polling, but it does not prominently warn that these calls can affect a live brokerage/futures account. In an agent-skill context, this is dangerous because an LLM or user may copy or adapt the code into a production environment and unintentionally place real trades, causing direct financial loss.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

This markdown file uses Chinese for the title and operating instructions, which effectively forces a specific language for users reading the skill documentation. The policy allows fixed locale/language only when there is user opt-in or a clearly justified region-specific constraint, neither of which is present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The printed messages and usage example are presented only in Chinese, which imposes a specific language on users without any opt-in or alternative locale. The policy explicitly flags language or locale constraints when the skill does not offer user choice or document a justified regional limitation.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This manifest description says the skill provides real-time market data, backtesting, and live trading, but it does not define any specific activation phrases, scope limits, or exclusion conditions. In a manifest file, such broad capability language can contribute to ambiguous or overly broad invocation behavior.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
94% confidence
Finding

The dependency uses a lower-bound version specifier only, which allows future unreviewed releases of tqsdk to be installed. This creates supply-chain and reproducibility risk because builds may pull in different versions over time, including versions with breaking changes or newly introduced vulnerabilities.

Content

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

text
tqsdk>=3.0.0
pandas>=1.5.0

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

The pandas dependency is not pinned to an exact reviewed version, so installations may resolve to different releases depending on time and environment. In a trading-related skill, this increases supply-chain risk and reduces reproducibility for analysis, testing, and deployment.

Content

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

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

Static analysis

No suspicious patterns detected.