Back to skill

Security audit

小果通达信公式转Python

Security checks for vulnerabilities and agentic risk

Overview

This skill is mostly a quantitative-analysis helper, but it includes under-scoped executable Python generation from formula files and repeated local file writes without clear safeguards.

Install only if you need Chinese TDX formula conversion and quantitative indicator examples. Do not convert or run formula files from untrusted sources, review generated Python before execution, choose explicit output paths, and expect the examples to fetch market data and create or overwrite Excel files.

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 (1)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:879
Finding

Untrusted Formula Input Is Converted into Executable Python Source

Content
View full analysis
MF1 and MF0>MF2','np.logical_and(MF0>MF1,MF0>MF2)') text12=text11.replace('MF0
Remediation
View remediation
Vulnerability Patterns
  • 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (10)

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

该 markdown/manifest 描述把触发条件定义为一长串宽泛关键词,包括“股票分析”“ETF分析”“指数分析”“量化投资”等泛领域术语,而没有说明必须在何种具体任务上下文中才应触发。缺少边界条件、排除条件或负例时,这类高频词很容易与普通金融问答重叠,导致非预期调用。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

文档示例直接调用 result.to_excel('策略信号结果.xlsx') 将分析结果写入本地文件,但附近没有明确提醒这会在本地生成或覆盖文件。对于 markdown 技能说明,涉及用户数据或文件系统变更时应有清晰披露,以帮助用户理解输出副作用。

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill includes source-to-source parsing and code generation logic that reads an input formula file, performs unsafe text substitutions, and writes executable Python to an output file. In a skill context, this broadens the attack surface from passive formula translation to generation of potentially unsafe code artifacts, enabling code-injection or malicious formula persistence if untrusted input is processed.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

Earlier documentation describes BARSCOUNT as counting the number of valid data periods to the current point, but this later redefinition returns range(len(CLOSE)), i.e. a running positional index regardless of NaN validity. This is an active contradiction between the documented intent and the actual code behavior.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

The docstring distinguishes 平空开多 and 平多开空, but the implementation assigns to 平空开多 twice and returns it in both output positions. This directly contradicts the documented intent by eliminating the distinct second signal.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The stated purpose is a TDX-formula-to-Python quantitative function library built on pandas/numpy, but large portions of the file import trader_tool.unification_data / qmt_trader.unification_data_qmt and fetch historical market data via get_hist_data_em(...). That external data-access capability goes beyond a pure formula-conversion/indicator library and is not declared in the manifest description.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

后续大量示例反复使用 result.to_excel(r'数据.xlsx') 等写盘操作,但文档整体没有集中说明这些示例会修改本地文件系统、可能覆盖同名文件。对 markdown 技能文档而言,这属于可能影响用户数据和系统状态的行为,应提前告知。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

文件从名称、描述到后续说明均默认使用中文,并在输出字段中大量采用中文标签,但没有声明这是面向中文用户的可选模式,也没有提供其他语言选项。若组织要求避免在未获用户同意时强制特定语言或区域设置,这种默认中文约束可能构成自然语言策略问题。

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The TQN documentation says the strategy will '先平空仓再开多仓', '先平多仓再开空仓', and '自动过滤交易信号'. In practice, the function merely returns channel highs/lows and raw boolean conditions, with no position handling or filtering logic implemented.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.