Back to skill

Security audit

xtquant

Security checks for vulnerabilities and agentic risk

Overview

This skill is for a real brokerage trading SDK and includes examples that can place trades, transfer funds, and expose account credentials without strong safeguards.

Review before installing. Use this only in a controlled XtQuant/QMT environment, prefer paper or test accounts first, add explicit confirmations and limits before any order or transfer call, never hardcode bank or fund passwords, redact account data from logs, and pin dependencies in your own lockfile.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (2)

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding

Unbounded Third-Party Dependencies in a Financial Trading Environment

Content
View full analysis
=1.0.0 pandas>=1.5.0 ``` The installation documentation executes these specifications directly: ```bash pip install -r ../requirements.txt ``` ### Technical Analysis Both dependencies use minimum-version constraints rather than exact, reviewed versions. Consequently, any future release satisfying these constraints may be selected during installation. The project provides no lockfile, package hashes, or repository URL through which users can validate dependency provenance. Python packages may execute code during installation or import. This is particularly sensitive for `xtquant`, because the documented environment connects the package to a local QMT/miniQMT client capable of reading financial information, submitting securities orders, and initiating account operations. This finding does not establish that the current packages are malicious. The vulnerability is the absence of controls ensuring that future installations resolve to the versions that were reviewed. ### Attack Path 1. An attacker compromises the package publishing account, package distribution channel, or an allowed future dependency release. 2. The attacker publishes a version satisfying `xtquant>=1.0.0` or `pandas>=1.5.0`. 3. A user follows the documented command and installs dependencies without a lockfile or hash verification. 4. The package manager resolves the compromised release. 5. Malicious code executes during installation or when the package is imported. 6. If executed on the trading workstation, the malicious package may interact with accessible local files, the Python process, network resources, or an authenticated QMT/miniQMT environment. ### Impact Asses ...[truncated 741 chars]
Remediation
View remediation
pandas== ``` 2. Generate and commit a lockfile containing transitive dependency versions. 3. Require package hashes, such as with a hash-locked requirements file and `pip install --require-hashes`. 4. Record the canonical package repository and publisher identity in project metadata. 5. Install dependencies inside an isolated virtual environment using a non-administrative account. 6. Perform dependency updates through a controlled review process that includes provenance verification, vulnerability scanning, and functional testing. 7. Separate market-data workloads from live-trading workloads where possible. 8. Prevent newly installed or unreviewed packages from running while a live trading session is authenticated. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
xttrader.md:1249
Finding

Hardcoded Banking Identifiers and Password Patterns in Executable Transfer Examples

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (25)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

This example wires real-time price callbacks directly to automatic buy and sell order submission, enabling unattended trading behavior with no explicit safety warning, confirmation gate, position/risk checks, or simulation-only framing. In an AI agent setting, this is especially dangerous because the agent could operationalize autonomous execution logic against a live account with immediate financial consequences.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
94% confidence
Finding

These examples normalize the use of live bank-transfer operations with credential parameters but do not clearly warn about handling real banking credentials or moving real funds. In a finance/trading skill, that context makes the omission more dangerous because users may copy the pattern into production scripts, exposing credentials or unintentionally triggering transfers.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The bank-balance query example uses a plaintext password and then iterates over and prints all object fields, which semantically encourages full disclosure of sensitive banking and account data. In this skill's live-finance context, that creates a realistic pathway to exposing balances, account numbers, and related metadata through logs, consoles, notebooks, or support artifacts.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The examples for bank transfer stream and shareholder account queries instruct users to dump complete returned fields, which may include bank account numbers, funding account IDs, transfer numbers, remarks, and shareholder identifiers. This is dangerous because it promotes over-logging of highly sensitive financial data, increasing the chance of privacy breaches, insider misuse, or leakage via debugging and monitoring systems.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document includes executable examples for placing buy/sell orders and canceling orders against a live trading interface, but provides no warning that these actions may affect a real brokerage account. In the context of a trading SDK quick reference, users often copy-paste snippets directly, so omission of safety guidance materially increases the risk of unintended real-money trades or cancellations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README includes a direct order_stock(...) example that appears to place a real trade against a live account, but it provides no warning that this can execute actual orders or affect real funds. In a trading SDK, copy-paste examples are highly likely to be executed by users, so omission of a safety warning increases the risk of unintended financial transactions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trading examples show live order placement, account subscription, asset queries, and order cancellation against a real broker-connected QMT client without an explicit warning that these calls can execute actual trades. In an agent skill context, users or downstream agents may treat the example as safe boilerplate and inadvertently submit real orders, causing financial loss or unintended market activity.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest describes an SDK integrating market data (xtdata) and trading interfaces (xttrade) for Chinese securities markets. In this file, the documented API also exposes state-changing management operations for custom sector folders and sectors, including create, add, remove, and reset actions, which are not naturally described as market-data retrieval or trading operations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The documentation exposes destructive operations such as removing sector members and deleting custom sectors without prominent warnings, confirmation guidance, or scoping constraints. In an agent setting, these functions could modify or delete user-maintained classifications unexpectedly, causing integrity loss and operational disruption even if the data is not highly sensitive.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The quick-start examples demonstrate live order placement and cancellation against a real trading client without any explicit warning that these actions can trigger real financial transactions. In a trading SDK context, omission of a safety warning increases the risk of accidental execution, especially by users copying examples verbatim into connected environments.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The example passes a bank password as a plaintext argument and encourages printing transfer results tied to bank/account operations. Even if the shown password is only illustrative, documentation that models inline secrets and verbose output trains insecure handling of sensitive financial credentials and can lead to credential leakage in source control, logs, or terminal history.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The skill documentation is entirely in Chinese and does not indicate any language choice, translation option, or region-specific justification. If organizational policy requires not forcing a specific language without opt-in, this is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The skill documentation appears to force a single language/locale for all users without offering an alternative or documenting that the skill is intentionally region-specific. Under the policy, language constraints should be optional, user-selectable, or clearly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The description and multiple section headings/instructions are partly or wholly in Chinese, which can impose a language constraint on users without explicit opt-in. Under the language/locale policy, skills should avoid forcing a specific language unless they clearly offer a choice or justify the locale restriction.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

This section provides operational guidance for AI agents exclusively in Chinese, while other parts of the document are bilingual or English-heavy. That creates an undocumented language requirement rather than a clear opt-in or justified locale notice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The file's instructional text is presented entirely in Chinese, which can amount to a language/locale policy violation when no user opt-in or alternative language is offered. The README does not indicate that the skill is region-specific or that Chinese is a required locale.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The description and tags specify the skill content only in Chinese, which can effectively force a specific language on users without offering an alternative or opt-in. The policy allows locale constraints when they are explicitly justified, but this metadata does not state that the skill is Chinese-language only or provide a language choice.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

The dependency specifier xtquant>=1.0.0 is unpinned, so installs may resolve to different versions over time. This creates a supply-chain and reproducibility risk because a newly released vulnerable or malicious version could be pulled without review, though the file itself does not indicate active exploitation.

Content

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

text
xtquant>=1.0.0
pandas>=1.5.0

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

The dependency specifier pandas>=1.5.0 is unpinned, which allows any later release to be installed. That weakens build reproducibility and increases supply-chain exposure if a future compromised or incompatible version is published.

Content

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

text
xtquant>=1.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.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The documented data_dir override lets callers redirect local reads to an arbitrary MiniQmt-style data path, which can cause the agent to operate on unintended local datasets or trust data from an unexpected location. In an agent context, especially if path input is user-influenced, this increases risk of unauthorized local data exposure or integrity issues through path confusion.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The section title and function name clearly indicate a removal operation, but the explanatory text at L1121 states '创建板块' (create sector). This is an active contradiction in the documentation that can mislead users about the intent and side effects of the API.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
99% confidence
Finding

The section title and signature describe an external transaction import API, but the prose says '通用数据导出' (general data export). This is an active contradiction about whether the operation imports external deal data or exports data, which can mislead users about a state-changing interface.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The heading and function name say this API transfers funds from futures to options, but the prose incorrectly states 'CTP资金内转(期权转期货)'. This is a direct contradiction on transfer direction for a money-moving API.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The function name and parameters indicate a bank balance query using bank credentials, but the description says '银行转账流水查询' and the return text says '银行转账流水信息'. That contradicts the actual documented fields like balance and enable_balance, which are account-balance data rather than transfer history.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.