Back to skill

Security audit

mquant coder

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed MQuant trading-strategy code generator, but users should treat generated strategies and bundled trading examples as financially sensitive code that requires manual review before live use.

Install only if you intend to develop Matic-MQuant strategies. Generated code and examples may place real trades when loaded and run in Matic, so review order logic, symbols, quantities, account type, risk limits, and any file deletion/version cleanup before using it outside a test environment.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (112)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
94% confidence
Finding

The strategy performs ETF purchase/redemption calls directly as part of its state machine, and those operations are effectively irreversible within the strategy flow. In an autonomous trading skill, executing such actions without an explicit safety gate, operator acknowledgement, or dry-run mode is dangerous because a logic error, stale market input, or partial-fill condition can commit capital and inventory changes that cannot be trivially unwound.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The stop-hook documentation says external-system interaction is not allowed, yet the function performs external SDK synchronization and shutdown calls via subscribe.sync() and common.fini(). If the host platform relies on shutdown hooks being side-effect-free, this can cause unexpected blocking, failed teardown, policy bypass, or unsafe interactions with external services during strategy termination.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

Incoming fast-parameter messages are parsed into live trading actions, including order placement and cancellation, with only superficial format checks and no authentication, integrity protection, replay defense, or user confirmation. In this strategy context, that means any party able to send or relay a matching custom message can potentially cause unauthorized trades or cancels across accounts handled by the strategy, making the issue especially dangerous.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

Incoming fast-parameter messages are parsed into live trading actions, including order placement across normal and margin accounts and order cancellation, with no operator confirmation, no origin authentication, and only weak format checks. In this strategy context, that is highly dangerous because message input directly controls financial transactions, enabling unauthorized trades, cancellations, or abuse of margin operations if an attacker can inject or relay messages.

Content

No source excerpt is available for this finding.

Hidden Instructions

High
Category
Prompt Injection
Confidence
60% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · README.md (reported line 1)May include surrounding context.

md
资金账号,算法类型,开始时间,结束时间,交易方向,委托类型,最大市场占比,单笔最小委托数量,单笔最大委托数量,撤单模式,委托间隔,撤单时间,委托档位,涨跌停委托控制,备注
23093442,SMARTTWAP,2020-10-22 09:30:00,2020-10-22 15:00:00,1,0,0.3,100,1000000,0,30,12,0,0,SMARTTWAP算法测试,
证券代码,数量,限价,
600000.SH,1000,20.10,

Hidden Instructions

High
Category
Prompt Injection
Confidence
60% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

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

md
资金账号,算法类型,开始时间,结束时间,交易方向,委托类型,最大市场占比,单笔最小委托数量,单笔最大委托数量,撤单模式,委托间隔,撤单时间,委托档位,涨跌停委托控制,备注
23093442,SMARTTWAP,2020-10-22 09:30:00,2020-10-22 15:00:00,1,0,0.3,100,1000000,0,30,12,0,0,SMARTTWAP算法测试,
证券代码,数量,限价,
600000.SH,1000,20.10,

Hidden Instructions

High
Category
Prompt Injection
Confidence
60% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · reference/mquant_inside_python_strategy/算法交易/AITWAP算法参数.csv (reported line 1)May include surrounding context.

text
资金账号,算法类型,开始时间,结束时间,交易方向,委托类型,最大市场占比,单笔最小委托数量,单笔最大委托数量,撤单模式,委托间隔,撤单时间,委托档位,涨跌停委托控制,备注
23093442,SMARTTWAP,2020-10-22 09:30:00,2020-10-22 15:00:00,1,0,0.3,100,1000000,0,30,12,0,0,SMARTTWAP算法测试,
证券代码,数量,限价,
600000.SH,1000,20.10,

Hidden Instructions

High
Category
Prompt Injection
Confidence
60% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · reference/mquant_inside_python_strategy/算法交易/AIVWAP算法参数.csv (reported line 1)May include surrounding context.

text
资金账号,算法类型,开始时间,结束时间,交易方向,委托类型,最大市场占比,单笔最小委托数量,单笔最大委托数量,撤单模式,委托间隔,撤单时间,委托档位,涨跌停委托控制,备注
23093442,SMARTTWAP,2020-10-22 09:30:00,2020-10-22 15:00:00,1,0,0.3,100,1000000,0,30,12,0,0,SMARTTWAP算法测试,
证券代码,数量,限价,
600000.SH,1000,20.10,

Hidden Instructions

High
Category
Prompt Injection
Confidence
60% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · reference/mquant_inside_python_strategy/算法交易/SMARTTWAP算法参数.csv (reported line 1)May include surrounding context.

text
资金账号,算法类型,开始时间,结束时间,交易方向,委托类型,最大市场占比,单笔最小委托数量,单笔最大委托数量,撤单模式,委托间隔,撤单时间,委托档位,涨跌停委托控制,备注
23093442,SMARTTWAP,2020-10-22 09:30:00,2020-10-22 15:00:00,1,0,0.3,100,1000000,0,30,12,0,0,SMARTTWAP算法测试,
证券代码,数量,限价,
600000.SH,1000,20.10,

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The document title and core instruction header are written entirely in Chinese, and the file provides operational guidance for using the skill without indicating that other languages are supported. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README is entirely written in Chinese and does not indicate that other languages are supported or that the Chinese-only presentation is an intentional, justified regional constraint. 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.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill describes automatic filesystem actions such as creating user files and later deleting old versions, but it does not present a clear up-front consent/confirmation model before those changes occur. In an agentic environment, silent file creation or deletion can lead to unintended modification or loss of user data, especially if the user does not fully understand that the skill performs writes and retention cleanup automatically.

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 order-placement examples that buy and sell securities but provides no warning that these calls may trigger real trades or affect live assets. In an API cookbook context, users may copy and run the snippets directly, creating a realistic risk of accidental financial transactions, especially because the examples use concrete symbols and share amounts.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The entire guide is written in Chinese and provides no indication that other languages are supported or that the language choice is optional. 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.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file presents all instructions, headings, and notes exclusively in Chinese. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified, which is not stated here.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The example strategy issues a real buy order when no position exists, but the surrounding documentation does not warn that this may trigger live trading with financial consequences. In an API reference for trading functions, copy-pasteable code that executes orders can cause accidental purchases by users who test the sample in a production or paper/live-linked environment without understanding the risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The function transter_fund_to_normal_account accepts a password parameter and initiates a real fund transfer, which is a safety-critical financial operation involving sensitive credentials. Although the docstring describes the parameters, it does not include any warning, confirmation requirement, or caution about securely handling the password or the irreversible financial impact of invoking this API.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The API exposes a helper that executes an external Python script via exec_py_impl, and unlike the neighboring external-data APIs its documentation does not state or enforce an initialization-only restriction. In a trading/agent skill context, this enables arbitrary local code execution under the strategy process if untrusted paths or parameters are influenced by other components, which is a real security boundary issue even if intended as a feature.

Content

No source excerpt is available for this finding.

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · reference/mquant_inside_python_document/mquant_api.py (reported line 1604)May include surrounding context.

python
:return qty, error_info: 1)请求失败,qty为'',error_info为原因;2)请求成功,qty为整数,error_info为''
        """
        return MarginTradeHandler.__impl.get_collateral_transferable_qty_for_trade(side,
                                                                                   symbol,
                                                                                   security_account,
                                                                                   counter_party_fund_account,
                                                                                   counter_party_security_account)

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · reference/mquant_inside_python_document/mquant_api.py (reported line 1605)May include surrounding context.

python
:return qty, error_info: 1)请求失败,qty为'',error_info为原因;2)请求成功,qty为整数,error_info为''
        """
        return MarginTradeHandler.__impl.get_collateral_transferable_qty_for_trade(side,
                                                                                   symbol,
                                                                                   security_account,
                                                                                   counter_party_fund_account,
                                                                                   counter_party_security_account)

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · reference/mquant_inside_python_document/mquant_api.py (reported line 1606)May include surrounding context.

python
:return qty, error_info: 1)请求失败,qty为'',error_info为原因;2)请求成功,qty为整数,error_info为''
        """
        return MarginTradeHandler.__impl.get_collateral_transferable_qty_for_trade(side,
                                                                                   symbol,
                                                                                   security_account,
                                                                                   counter_party_fund_account,
                                                                                   counter_party_security_account)

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · reference/mquant_inside_python_document/mquant_api.py (reported line 1607)May include surrounding context.

python
:return qty, error_info: 1)请求失败,qty为'',error_info为原因;2)请求成功,qty为整数,error_info为''
        """
        return MarginTradeHandler.__impl.get_collateral_transferable_qty_for_trade(side,
                                                                                   symbol,
                                                                                   security_account,
                                                                                   counter_party_fund_account,
                                                                                   counter_party_security_account)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This Python file contains pervasive user-facing natural-language documentation in Chinese only, including class docstrings and explanatory comments beginning at L0007 and continuing throughout the file. Under the policy, forcing a single language without offering a choice or documenting a justified locale constraint is a language-policy violation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The sell branch uses tick.current > low_level_price while the comment and strategy description indicate a sell should occur when price breaks below the lower band. In a live trading strategy this reverses the intended trigger and can cause widespread unintended sell orders under normal market conditions, materially changing portfolio behavior and increasing loss risk.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The order pricing logic compares the tick object itself to OrderSide.BUY instead of checking self.side. This makes the buy/sell branch selection incorrect, so orders may be priced using the wrong side of the book or fallback limits, leading to failed execution or materially adverse fills in a trading system.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.