Back to skill

Security audit

A Share Overnight Trading

Security checks for vulnerabilities and agentic risk

Overview

The skill is a disclosed A-share overnight trading guide, but its mock backtests can present synthetic results as actionable strategy guidance and some scripts write predictable files in /tmp.

Install only if you understand this is educational trading material, not a reliable stock-picking system. Do not rely on the mock backtest output for real trades, use verified market data and independent review, and be aware that running the backtest scripts writes files under /tmp using predictable names.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/backtest_engine.py:408
Finding

Predictable shared temporary files allow symlink-based file overwrite

Content
View full analysis
0) win_rate = winning_trades / total_trades * 100 if total_trades > 0 else 0 avg_pnl = sum(t['pnl'] for t in self.trades) / total_trades if total_trades > 0 else 0 f.write(f"总交易次数: {total_trades}\n") f.write(f"胜率: {win_rate:.1f}%\n") f.write(f"平均盈亏: {avg_pnl:.2f}%\n") ``` ### Technical Analysis The scripts write to fixed, globally predictable filenames in the shared `/tmp` directory. The output operations do not use exclusive file creation, verify file ownership, reject symbolic links, o ...[truncated 1967 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/position_calculator.py:55
Finding

Unvalidated position percentages can produce negative or non-finite trading recommendations

Content
View full analysis
Remediation
View remediation
self.params['max_single_position']: raise ValueError("Position percentage exceeds the single-position limit.") ``` 3. Apply equivalent validation to every value supplied through `--percents`. 4. Validate `stock_price` and `total_capital` inside the class methods rather than relying only on CLI validation, because the class may be imported and called directly. 5. Reject non-finite prices and capital values in addition to checking that they are positive. 6. Add tests for negative values, zero, NaN, positive and negative infinity, and percentages above the configured limit. ]]>
Vulnerability Patterns
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (20)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The description presents the skill as a strategy/guidance tool for selecting a stock for overnight trading, emphasizing screening criteria, workflow, risk control, and discipline. The supplied code instead primarily acts as a quantitative backtest engine that simulates the strategy over a date range, analyzes outcomes, and generates saved result files. The stock-screening logic is related and consistent with the declared domain, but the primary purpose is materially different: evaluation of the strategy on historical/mock data rather than operational use for daily decision support. The CSV loading and file output are secondary but still undeclared resource interactions. Therefore this is a description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

描述的核心能力是“隔夜交易法选股策略”,重点应在选股、筛选规则、主板范围约束、交易时机与纪律说明;而代码的核心功能仅是仓位/买入数量计算。它不处理股票代码、行情、筛选条件、策略信号,也不限定A股主板标的,更没有实现‘选一支股票’的策略决策。虽然仓位控制和风险提示与交易策略存在一定相关性,但这只是配套工具,不足以支撑所声明的主要用途。因此描述与实际行为存在明显且实质性的功能不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

声明强调的是一个可用于实际A股主板隔夜交易决策的选股策略技能,应能围绕主板股票筛选、交易执行步骤和风险控制提供实用能力。而代码只是 test_backtest.py:生成随机模拟行情数据,基于硬编码与随机概率决定哪些股票“passed”,再输出一段静态分析文本。它没有接入真实行情,没有实现完整选股逻辑服务用户每日决策,也没有实现操作流程、风控或纪律约束。虽然主题上与“A股隔夜交易法”相关,但主要用途从“实际选股策略技能”变成了“测试/回测模拟数据脚本”,属于实质性不匹配。

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest description is entirely scoped to A股主板 trading and written as a Chinese-only user-facing skill description, with no indication that users may choose another language or locale. Under the policy rule, forcing a specific language/locale without opt-in can be a natural-language policy violation unless clearly documented as a justified region-specific tool.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This section explicitly instructs users to progress from simulated trading to live trading with concrete position-sizing guidance, but it does not include a clear warning that real-money trading can cause partial or total financial loss. In the context of a skill dedicated to overnight stock trading, the absence of an explicit financial-risk disclaimer can encourage inexperienced users to treat the strategy as operational guidance rather than educational content, increasing the likelihood of harmful financial decisions.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

技能清单描述的是用于每日尾盘从A股主板中选一支股票进行隔夜交易的策略能力,重点在选股规则与执行纪律。该脚本除分析外,还将回测图表和详细交易结果持久化到/tmp文件中,这属于额外的数据产出/文件写入行为,而不是实现该选股策略所必需的核心能力。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code file contains user-facing natural language in the module docstring that assumes Chinese as the required language. Under the policy, forcing a specific language without user opt-in is a violation unless the locale restriction is explicitly justified, which is not present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script presents user-facing summaries, recommendations, warnings, and argparse descriptions exclusively in Chinese. Because no language selection or documented locale justification is provided, this constitutes a natural-language policy issue rather than a code-security issue.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest limits the strategy to A股主板 with codes starting 60 (Shanghai) and 00 (Shenzhen main board). The hardcoded pool also contains 601xxx, 603xxx, and 002xxx symbols, and the board check only enforces prefixes 60 or 00, so the actual operational universe is broader and inconsistent with the stated scope.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest describes a skill for selecting one A-share main-board stock each day for overnight trading, including screening rules, workflow, risk control, and execution discipline. This file instead implements a historical simulation/backtest engine and writes a backtest report to disk, which is a materially different behavior from providing the described operational selection skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The file’s natural-language description and all user-facing strings are written exclusively in Chinese, including the top-level purpose statement. Under the policy, forcing a specific language without user opt-in is a locale/language constraint that should be either optional or explicitly justified.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script explicitly states conclusions such as '根据回测结果显示' while only generating random simulated data, which can mislead users into believing the strategy was validated by an actual backtest. In a trading skill, this is dangerous because it may cause users to trust unsupported performance claims and make financial decisions based on fabricated evidence.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

A file-wide natural-language policy issue exists because all headings and instructions are presented only in Chinese, and there is no indication that the skill is region-specific or that users can opt into this locale. The policy calls for flagging language or locale constraints when they are imposed without user choice or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown file contains user-facing instructional content exclusively in Chinese, and nowhere indicates that the skill is region-specific or that users may choose another language. Under the language/locale policy, forcing a specific language without opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

Natural-language strings in the module docstring, comments, argparse description, and console output consistently force Chinese-language interaction. Under the language/locale policy, this is a violation unless the skill offers user choice or clearly documents a justified region-specific constraint.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script generates and saves a PNG chart file to /tmp/overnight_backtest_chart.png as part of analysis. The save is only disclosed after the fact, so the file-writing side effect is not clearly communicated beforehand to users invoking the skill.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This code file performs a file write by exporting detailed trade results to /tmp/overnight_backtest_results.csv. Although it prints after saving, there is no warning before execution in the argument help, main flow, or top-level description that running analysis will create an output file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code file contains user-facing natural language in the module docstring and throughout CLI help/output that is exclusively Chinese. Under the policy, forcing a specific language without opt-in can be a locale/language policy violation when no alternative language choice or justification is provided.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This code file contains user-facing docstrings and console output exclusively in Chinese, including startup messages, analysis output, and warnings. Under the policy rule, forcing a specific language without offering the user a locale or language choice is a natural-language policy violation.

Content

No source excerpt is available for this finding.